Questions tagged [nswindow]

an apple class that defines objects that manage and coordinate the windows an application displays on the screen

The NSWindow class defines objects (known as windows) that manage and coordinate the windows an application displays on the screen. A single NSWindow object corresponds to at most one onscreen window. The two principal functions of a window are to provide an area in which views can be placed and to accept and distribute, to the appropriate views, events the user instigates through actions with the mouse and keyboard.

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html

1332 questions
11
votes
4 answers

Cocoa window position anomaly

I have a weird problem with positioning a window on screen. I want to center the window on the screen, but i don't know how to do that. Here's what i've got. The window is created from nib by the main controller: IdentFormController *ftf =…
Marius
  • 111
  • 1
  • 3
11
votes
2 answers

Show Window without activating (keep application below it active)

I need to show a window (without title bar) above third party applications without my window taking focus. I have tried using an NSPanel and setting enabling non-activating, but that didn't help. I tried orderFront:self, but that didn't help…
user429620
10
votes
1 answer

Get NSWindow from kCGWindowNumber

From kCGWindowNumber, how do I get NSWindow ref. I tried using: [NSApp windowWithWindowNumber:windowNumber] but I always get a null value. I need to get the NSWindow to apply [window setlevel:NSFloatingWindowLevel], that I have set the always on…
Esse
  • 121
  • 1
  • 5
10
votes
3 answers

Reading NSWindow resize event

I was wondering if anyone knows, how do I read when NSWindow is being resized? Let's imagine I have a button in an empty window (other than the button), then user resizes the window from the bottom right corner, now I should make it so that the…
user1632861
10
votes
1 answer

Button to open view in new window SwiftUI 5.3 for Mac OS X

I would like to have a button to open a new window and load a view (for the app's Preferences) in SwiftUI for MacOS but am unsure of the correct way to do it. I tried creating a function and calling it from the button action which works but on…
mousebat
  • 474
  • 7
  • 25
10
votes
2 answers

Cocoa - Core Animation - How to stop proxy animation?

I have an NSWindow which I fade in from invisible to full opacity, over a custom time, using the animator proxy: [NSAnimationContext beginGrouping]; [[NSAnimationContext currentContext] setDuration:1.0f]; // Custom timing, 1 sec. [[myWindow…
SirRatty
  • 2,338
  • 5
  • 25
  • 37
10
votes
4 answers

How to change the height of an NSWindow titlebar?

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…
Flocked
  • 1,898
  • 2
  • 36
  • 57
10
votes
0 answers

How to NOT highlight the NSButton's template image when clicked?

I have NSButtons in each row of a NSTableView. The buttons images are set in IB and are black icons with alpha channel: The windows are set to dark mode with: window?.appearance = NSAppearance(named: NSAppearanceNameVibrantDark) And to normal…
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
10
votes
2 answers

Window visible on all spaces (including other fullscreen apps)

I'm trying to make a window (NSWindow) visible on all the spaces including other full screen app windows. I've been trying to set a higher window level as well as playing with expose and spaces settings in the inspector. I found some solutions here,…
10
votes
1 answer

NSWindowController showWindow:nil does nothing

Like in the title, [myWindowController showWindow:nil] doesn't work. Here are some facts you may need to know: My window controller: KRAuthenticationWindowController Interface builder file: AuthenticationWindow.xib File's Owner is…
akashivskyy
  • 44,342
  • 16
  • 106
  • 116
10
votes
3 answers

How can I implement gesture recognizers in OS X?

I have done quite a bit with gesture recognizers for iOS, but I am now doing work in OS X, and I am lost. I want to duplicate the functionality that exists like in Finder where you can two-finger swipe (on your magic mouse) to go back/forward…
Westley
  • 1,143
  • 14
  • 27
9
votes
1 answer

Handling mouse events on transparent window conditionally

I am developing an Desktop application in which I should be able to take mouse events on transparent window. But, transparent NSWindow does not take mouse events. So, I have set setIgnoreMouseEvents to NO which allows the transparent window to take…
spd
  • 2,114
  • 1
  • 29
  • 54
9
votes
5 answers

NSWindow Shadow Outline

I am drawing a custom window by setting a custom content view for the window. When I draw the custom view I give it rounded corners and a nice outline to mimic a proper window. However, I see another 1 px outline around the window which strays from…
Joshua
  • 15,200
  • 21
  • 100
  • 172
9
votes
2 answers

NSPopover to start in a detached state

Is there a way to force the NSPopover to start in the detached state? I only see isDetached which is a read-only property for the state of the popover and an NSPopoverDelegate method detachableWindow(forPopover:) which lets me override the window…
Kirkova
  • 319
  • 1
  • 9
9
votes
2 answers

NSWindowController and NSViewController

Probably a pretty simple question, but I can't get my head around it. I would like to create some sort of wizard: An NSWindow appears as a sheet from another NSWindow and should show three different NSViews one after another. I think I should create…
fabian789
  • 8,348
  • 4
  • 45
  • 91