nswindow

Cocoa - NSWindow animation when displayed?

别说谁变了你拦得住时间么 提交于 2019-12-07 08:19:12
问题 How would I add some sort of CoreAnimation effect when showing a simple nswindow? Thanks 回答1: I've done an animation like you describe before. However, it wasn't an easy task. Since your animation extends outside the bounds of the window itself, you'll need to render the animation in an oversized, transparent window. When the animation completes, you can order in the real window and remove the transparent one. You'll need an image of the window to use as the content of your animation, so what

Main NSWindow shadow doesn't change like child windows

我们两清 提交于 2019-12-07 07:27:15
问题 The primary window in my app is borderless: [self.window setStyleMask:NSBorderlessWindowMask]; From that window, I also open other child windows. When I click around between those other child windows I see the drop shadow of those child windows get darker/larger when that child window gets clicked and becomes the focused window. However, my main window's shadow doesn't change when it loses or gains focus. So, there isn't much user feedback to tell them that original primary window has become

Layering Cocoa WebView - Drawing on top?

扶醉桌前 提交于 2019-12-07 05:08:06
问题 webview in core animation layer The only other thread I can find is the above which doesn't necessarily fit my needs. Is there a reliable way to simply draw a view on top of a webview? I've tried to layer a regular NSView on top of WebView, and it draws right at first, but any movement in the webview (scrolling the page etc) appears to invalidate the view and produces visual artifacts. I've tried: [[[NSApp mainWindow] contentView] addSubview:view positioned:NSWindowAbove relativeTo:webView];

How to disable NSDocument's window title popup

↘锁芯ラ 提交于 2019-12-06 23:21:31
问题 I have an NSDocument based app with autosave enabled. I'd like to prevent this popup from showing: I have tried returning nil from NSWindow's –title, –representedFilename and –representedURL which hide the title effectively hide the title but have no effect on the downward facing disclosure indicator and the popup. Is there a way I can prevent this popup from being presented? 回答1: I was able to prevent the button from being shown by overriding NSWindow's + (NSButton *)standardWindowButton:

Click through custom NSWindow

泄露秘密 提交于 2019-12-06 16:09:20
问题 I have custom NSWindow with custom NSView set as its contentView. The window gets initialized with: [window setOpaque:NO]; [window setBackgroundColor: [NSColor clearColor]]; [window setHasShadow: NO]; [window setAcceptsMouseMovedEvents: YES]; [window setLevel: NSFloatingWindowLevel]; Content view, in its drawRect draws simple circle filled by solid color. All this works OK - the window appears on desktop and I see that circle. The only thing that does not work: the whole window rectangle is

capture hidden NSWindow

主宰稳场 提交于 2019-12-06 16:08:21
I'm able to capture NSWindow s which are visible using code simular to the SonOfGrab Example But how can I capture a hidden NSWindow ? Or what is the way to hide a NSWindow from the user but to still appear in de Windowserver? Thanks in advance! It isn't possible to capture the contents of an NSWindow which isn't visible on-screen. When a window is minimized/hidden/whatever, the visual representation is dropped to save memory. (Not sure on exactly how this is managed, feel free to chime in if you have a deeper knowledge of the window system. I only know this from experience, trying to capture

Hotkeys? Key events?

心不动则不痛 提交于 2019-12-06 14:14:04
问题 I'm trying to make a window open when the user pressed Cmd + L but how can I make my controller object listen to that particular key combination? 回答1: Create a menu item, set its shortcut to Cmd-L, and connect it to an action on that controller (or on another controller, which forwards to your desired controller). Or ... read the Handling Key Events section of the Cocoa Event-Handling Guide and implement a custom view that, when it is the first responder, interprets this key event and

Cocoa - How to bring particular window to come in foreground from StatusMenu

让人想犯罪 __ 提交于 2019-12-06 13:55:25
问题 I am working on an Mac Application. I have set Application is agent (UIElement) = YES in plist, and App have a Window (lets say Popup Window) that acts as custom PopOver for StatusMenu. One more window is there (lets say Window B) that should opened on selecting a Link from StatusMenu that i have made, but Problems that I am facing are as follow: On Application launch, When I opens status Menu It also showing Window B , that actually should not be Shown. Window B is allocated and initialised

How can I set the title of non-main-windows in an NSDocument application?

核能气质少年 提交于 2019-12-06 11:50:09
I am working on a document-based OSX application, with master-detail style windows. I understand how to open additional windows, to display additional information, by using -makeWindowControllers and adding extra window controllers, but I can't set the title of the new windows. I have tried using -setTitle and -windowTitleForDocumentDisplayName in both Document.m and in my sub-classed window controller class, but I can't get the window title to change. How do I change the title of non-main-windows, which have a sub-classed window controller, in an NSDocument based application? EDIT: I know

NSTextField inside NSPopover is not key until mouse click

a 夏天 提交于 2019-12-06 09:22:32
I've got an NSPopover that is shown from interaction with an NSStatusItem. I've blogged about the hacks I needed to do to make input even possible in this situation here: http://blog.brokenrobotllc.com/using-nspopover-with-nsstatusitem I have an NSTextField inside the NSPopover's content view. When I open the NSPopover, the NSTextField appears as if it is key (the cursor blinks). But, when typing, nothing shows up. If I click the mouse in the field, my input starts showing up there. I've tried things like invoking NSWindow's makeFirstResponder upon popoverDidShow:. There was no change in