nswindow

NSWindow Mac App Store like Title Bar

纵饮孤独 提交于 2019-11-27 00:58:00
问题 How could I make an NSWindow 's title bar look like that of the Mac App Store or of the app Feeder where it's height is increased and other controls are show in it. To see what I mean just check out the website for the Mac App Store : http://www.apple.com/mac/app-store/. Is it a custom NSWindow or is it a completely borderless window with an NSView made to look like the title bar? 回答1: https://github.com/indragiek/INAppStoreWindow Title bar and traffic light customization for NSWindow

Put a transparent NSWindow permanently on top of another NSWindow

放肆的年华 提交于 2019-11-26 23:04:35
问题 I want to have some UI controls on top of a NSWebView and because of this problem " https://stackoverflow.com/questions/9120868/video-in-nswebview-hides-views-on-top-of-the-nswebview " I now want to add a "transparent" NSWindow , so without the close buttons etc., on top of my NSWebView , hence, on top of my current NSWindow . How can I achieve this and make sure that this "overlay window" stays in place, even if I move the underlying window? EDIT: : While @dzolanta's approach works fine, I

Non-resizable window swift

非 Y 不嫁゛ 提交于 2019-11-26 21:23:49
问题 I have a NSViewController named Hardness , and I need not to let user resize it. Of course, I can just resize it back every time the users tries, but is there any way just not to let user open a window to full screen, or to stretch the window? 回答1: edit/update: Xcode 10.2 • Swift 5 NSWindow has a property called styleMask that allows you to control what kinds of control will be available to the user. If you don't want to allow the user to resize the window you have to remove the style mask

How to make a smooth, rounded, volume-like OS X window with NSVisualEffectView?

霸气de小男生 提交于 2019-11-26 19:12:33
问题 I'm currently trying to make a window that looks like the Volume OS X window: To make this, I have my own NSWindow (using a custom subclass), which is transparent/titlebar-less/shadow-less, that has a NSVisualEffectView inside its contentView. Here's the code of my subclass to make the content view round: - (void)setContentView:(NSView *)aView { aView.wantsLayer = YES; aView.layer.frame = aView.frame; aView.layer.cornerRadius = 14.0; aView.layer.masksToBounds = YES; [super setContentView

How do I create a Cocoa window programmatically?

旧巷老猫 提交于 2019-11-26 18:56:22
问题 My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime? This is my non-working attempt so far. I see no result whatsoever. NSRect frame = NSMakeRect(0, 0, 200, 200); NSUInteger styleMask = NSBorderlessWindowMask; NSRect rect = [NSWindow contentRectForFrameRect:frame styleMask:styleMask]; NSWindow * window = [[NSWindow alloc] initWithContentRect:rect styleMask:styleMask backing: NSBackingStoreRetained defer:false]; [window

Keep window always on top?

不想你离开。 提交于 2019-11-26 18:03:26
问题 In Objective-C for Cocoa Apps it's possible to use such way to keep window always on top? How to achieve the same with Swift? self.view.window?.level = NSFloatingWindowLevel Causes build error Use of unresolved identifier 'NSFloatingWindowLevel' 回答1: To change the window level you can't do it inside viewDidload because view's window property will always be nil there but it can be done overriding viewDidAppear method or in a IBAction method: Swift 1 override func viewDidAppear() { super

How to create a transparent window with non-rectangular buttons?

ⅰ亾dé卋堺 提交于 2019-11-26 16:55:30
问题 I am looking to make a custom window which would look something like this (never mind the quick photoshop): The main problem I have is not to make the window transparent (although I guess any info is welcome!), but that I want to be able to click only on the visible part of the buttons. For example, if I click just outside the top left of the "5" button, I want it to register a click on the "1" button and not the "5" button, even though I clicked in button 5's bounding box. And if I click

Why NSWindow without styleMask:NSTitledWindowMask can not be keyWindow?

本小妞迷上赌 提交于 2019-11-26 14:06:56
问题 Problem: I have one window mainWindow and another childWindow added to mainWindow . childWindow is kind of WindowExt class. This class I define for catch method call [NSWindow becomeKeyWindow] that must be called after [childWindow makeKeyWindow] . If I create childWindow and try to make it keyWindow on next way: WindowExt *childWindow = [[WindowExt alloc] initWithContentRect:addedWindowRect styleMask:NSBorderlessWindowMask | NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];