nswindow

How to tell when Cocoa MainMenu controls have been loaded

How can I tell when all of the MainMenu nib controls (primarily the main window) have been loaded? I want to display a sheet on top of the main window at launch, but when I put call beginSheet inside of awakeFromNib, I get an error because no windows have been displayed yet: : kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1 How ...

Is there an easy way to change a NSWindow NIB into a NSView NIB?

I started out with some items as NSWindows but my GUI is evolving and these elements would be better suited as NSViews. Is there a way to convert an NSWindow NIB into an NSView NIB? ...

Cannot set an NSWindow's position

I have a class that extends NSWindowController and I am trying to position the window it controls. The window displays all of the expected contents and functions correctly, but when I try and position its starting location on the screen in the initWithWindowNibName method, the position does not change. Here is the code: NSPoint p = NSMa...

Custom OSX window skin?

How do I make custom buttons for my app window on OSX? I'd also like to skin the entire window. Are there any easy classes or ways to do this? Any tutorials that show how? ...

Cocoa: Does there exist an NSView with user resize capability?

I want an NSView that can be resized by dragging its the bottom right corner around, just like an NSWindow. I want to be able to embed this NSView into a parent NSView. Is there a component like this in Cocoa or any of its extensions? ...

Reimplementing the Mac OS X Dock's auto hide

I'm trying to make a server monitor in Objective-C, that behaves kind of like the dock on Mac OS X. I'm hoping to have it slide from the side of the screen when the mouse is moved to a side of the screen, kind of like a dock with auto hide on. I'm not sure where to start though. I'm guessing I need to have a window with a NSBorderlessWi...

Quit app when NSWindow closes

How correctly to quit the Mac OS X app, when the main (the only one) closes? I know there a method - (void)windowWillClose:(NSNotification *)notification in NSWindowDelegate. But it isn't quite suitable in my case, because it is called before NSWindow closes. ...

Round corners on a borderless NSWindow.

I'm creating an application and I don't want a title bar: If the title remains the same all the time, does it make sense to show it? For example, if an app doesn’t show the names of documents, or any other assets that it opens, and there is plenty of space at the top around other controls to grab onto if you want to move the window a...

NSWindow created in IB won't show modally in the application

Hi, I have an application that when pressing a button it should show a modal window. I have some questions about it but I'm going to narrow it to what it's giving me a headache. I want to add that I'm already doing something alike that when applied to this particularly case won't work. What I already do is to show modally a NSOpenPan...

What does NSApp hide: actually do with the NSWindow instances?

Hi, I'm working on an NSWindow subclass and I'm running into some strange behavior that makes me question some of my assumptions about how windows work on Mac OS X. What precisely happens to NSWindow instances when [[NSApplication sharedApplication] hide: self] is called? All windows that do not return NO to -(BOOL)canHide disappear f...

How to get a list of all open NSWindow from all running application?

Is there a way to get list of open or visible NSWindow from mac desktop? ...

How to grab an image of an offscreen NSWindow?

I'm trying to get an image of an offscreen window to use in a CALayer-based animation, but no matter which method I try I cannot get an image out the other side. Here is the code I've been using on a custom NSWindow subclass in my project: CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, ...