nswindow

Title Bar Buttons and Custom Title Bars

帅比萌擦擦* 提交于 2019-12-18 12:00:58
问题 I have created a custom title bar view for a blackened NSWindow (style 0), so that I can have it disappear in a similar manner to Quicktime X. The only problem is, the buttons don't respond to mouse over and mouse move actions on the title bar can get combined with pressing in the buttons. The full source code is here: https://github.com/iaefai/OrganicUI under Classes/ORTitleBar.m and ORWindow.m. The buttons are standard from this method: self.closeButton = [NSWindow standardWindowButton:

How to change the height of an NSWindow titlebar?

本小妞迷上赌 提交于 2019-12-18 10:28:10
问题 I want to change the height of an NSWindow titlebar. Here are some examples: And… I could use an NSToolbar, but the problem is that I can't place views very height (For example: I can't place the segmentedControl higher than in the picture because there is still the titlebar) If I remove the titlebar I can't place a NSToolbar and the window isn't movable. Have you any ideas? 回答1: INAppStoreWindow is a NSWindow subclass, it tell you how to change the height of title bar. https://github.com

How to change the height of an NSWindow titlebar?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 10:27:03
问题 I want to change the height of an NSWindow titlebar. Here are some examples: And… I could use an NSToolbar, but the problem is that I can't place views very height (For example: I can't place the segmentedControl higher than in the picture because there is still the titlebar) If I remove the titlebar I can't place a NSToolbar and the window isn't movable. Have you any ideas? 回答1: INAppStoreWindow is a NSWindow subclass, it tell you how to change the height of title bar. https://github.com

Hide MAAttachedWindow when clicking outside

梦想与她 提交于 2019-12-18 03:46:23
问题 I'm using an MAAttachedWindow to display a custom window under a NSStatusItem in the Menubar. Everything works fine, but I can't find an easy way to hide it when the user clicks outside of the window. I want to implement this behavior because it's what the user expects. This is the code used to display the MAAttachedWindow : - (void)toggleAttachedWindowAtPoint:(NSPoint)pt { if (!self.attachedWindow) { self.attachedWindow = [[MAAttachedWindow alloc] initWithView:logView attachedToPoint:pt

Custom NSWindow in 10.9 Doesn't show shadow when SetOpaque:NO

浪子不回头ぞ 提交于 2019-12-13 20:00:34
问题 So I have created an NSWindow (with rounded corners), and in 10.10, it has a shadow around it. However when I tested in 10.9, the shadow disappeared. I have set breakpoints at every possible point, and [window hasShadow] is always YES. If I set [self setOpaque:YES] in the initWithContentRect method of the window, the shadow comes back. Has anybody seen this before? Or know what could possibly cause this? It appears the hasShadow property doesn't do anything because if I set it to YES/NO it

Is it ok to send normal messages via Interface Builder's binding’s model key path?

穿精又带淫゛_ 提交于 2019-12-13 05:16:40
问题 Is it ok to send normal messages via Interface Builder's binding’s model key path ? I want to enable some menu items only if the main window of my application is visible. I simply tried the following to see what would happen: In the bindings inspector of the menu item i bind Availability-Enabled to the AppDelegate and set the model key path to self.window.isVisible . This seems to work well, but is it meant to be used like this? Legal in the AppStore? A little exclamation mark appears next to

How do i display the modified dot in the red button of an NSWindow

浪尽此生 提交于 2019-12-13 03:59:52
问题 Can't find the Cocoa API call to set the modified marker of a window. 回答1: If you’re using the NSDocument architecture it should happen automatically. If not, and you’re using NSWindowController, you should use its setDocumentEdited: method. If you’re not using a window controller, use NSWindow’s setDocumentEdited: method. 来源: https://stackoverflow.com/questions/3581375/how-do-i-display-the-modified-dot-in-the-red-button-of-an-nswindow

Hide/Show all objects in a NSWindow - Cocoa

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:49:14
问题 Quick question. How can I hide and then show all the objects in a NSWindow without doing something terribly tedious and complicated? Kevin 回答1: I may be late to this particular party, but how about this? [[window contentView] setHidden:YES]; And conversely... [[window contentView] setHidden:NO]; That's certainly less tedious and complicated. :D 回答2: for(NSView* view in [[window contentView] subviews]) { [view setHidden:YES]; } 回答3: Assuming everything is a NSView: //Hide views for (NSView

Resizing NSWindow beyond the dock

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 02:43:26
问题 I am trying to resize an NSWindow to a certain size: NSRect frame = [_window frame]; frame.size.width = 1024; frame.size.height = 768 + 42; // add 42 for window frame [_window setFrame: frame display: YES]; [_window center]; The adjusted height is always clipped at the Mac OS X application dock so in my case the view inside the window height will not be 768 but 680. Is there a way to force it to resize beyond the dock? 回答1: Fixed it by implementing a subclass to override constrainFrameRect

How to reverse a [NSWindow zoom] method call?

若如初见. 提交于 2019-12-13 02:00:08
问题 Maybe i'm just too blind to RTFM but what is the method to call to reverse the zoom (maximizing of a window) and bring the window back into the old state. 回答1: According to the documentation for the zoom: method (note the : ), the inverse of zoom: is zoom: : This action method toggles the size and location of the window between its standard state (provided by the application as the “best” size to display the window’s data) and its user state (a new size and location the user may have set by