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
8
votes
2 answers

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?
Max
  • 1,203
  • 1
  • 14
  • 20
8
votes
2 answers

How to close a Full-Screen mode NSWindow programmatically?

My application has two windows(main and video) and both can enter the Full-Screen mode independently. And the main window has a button to toggle the video window's visibility. When the video window is visible, the button simply sends close message…
YoonHo
  • 1,046
  • 9
  • 10
8
votes
3 answers

How to disable NSDocument's window title popup

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…
pfandrade
  • 2,359
  • 15
  • 25
8
votes
3 answers

Change mouse cursor over inactive NSWindow

I have subclassed NSWindow and I have a MYWindow class implementing the following method: -(void)resetCursorRects { NSImage *image = [NSImage imageNamed:@"cursor.png"]; [image setSize:NSMakeSize(32, 32)]; NSCursor *cursor = [[NSCursor…
www.jensolsson.se
  • 3,023
  • 2
  • 35
  • 65
8
votes
2 answers

NSWindow - borderless, transparent window - flickering shadow when animating window height

Here's another NSWindow question ... I've got borderless window, transparent, which is created in this way ... - (id)initWithView:(NSView *)view anchorPoint:(NSPoint)anchorPoint position:(NSPoint)position distance:(CGFloat)distance { if ( !view )…
zrzka
  • 20,249
  • 5
  • 47
  • 73
8
votes
3 answers

Custom NSWindow with rounded corners which clip subviews

I'm trying to create a custom NSWindow, so I've created one with the proper borderless window mask and that works. I provide my own content view which is fine. But what I'm trying to do is draw with rounded corners that also clip subviews to those…
jbrennan
  • 11,943
  • 14
  • 73
  • 115
8
votes
3 answers

NSWindow restorable not always working

I have checked the restorable option on my NSWindow When I move my application and change its size and close/reopen my application it sets the window size and position to the last size and position but this doesn't happen on every computer where i…
Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91
8
votes
4 answers

How to force an NSWindow to be always active/focused?

I have a transparent NSWindow that follows the user's screen everywhere he goes (the NSWindowstays in front of every app, no matter what, even fullscreen apps). In that NSWindow i have a mouseDown event that shows a popup. Let's say i'm on safari in…
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76
7
votes
2 answers

What does “initial position” do in Xcode's nib editor?

Editing my nib for a document-based Cocoa application, I see that when I have a window or panel selected, Xcode lets me set its “initial position”: This is separate from the window's Frame, which is above it, so what is this? What uses the “initial…
Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
7
votes
1 answer

All-sides resize of borderless NSWindow in Lion

In Lion, the standard resize method for windows changed from the lower-right corner to all sides, with an invisible area to click and drag. I have a custom borderless window, similar to the App Store, on which I would like to have this resize…
user647562
7
votes
0 answers

SwiftUI macOS View toolbar not showing in a new window

I have the following view in my macOS app: struct ViewWithToolbar: View { var body: some View { Group { Text("Hello from ViewWithToolbar!") .padding() } .toolbar { Button("Action1")…
Eilon
  • 2,698
  • 3
  • 16
  • 32
7
votes
3 answers

Mac OS X, make a window go over menu bar

Is it possible to make a window to go over the menu bar, without going in fullscreen? Thanks in Advance!
mxg
  • 20,946
  • 12
  • 59
  • 80
7
votes
3 answers

NSWindow - show new window that will always stay on top of current window

I want my NSWindow to show new window(s) that will always be on top of current window. they should NOT be on top of other windows. In addition, they should not move when the original window moves. How can i do that?
Erik Sapir
  • 23,209
  • 28
  • 81
  • 141
7
votes
4 answers

How to put SwiftUI button into NSToolbar?

This is how SwiftUI can be inserted into NSToolbar using an accessory view controller: import SwiftUI import PlaygroundSupport var hostingView = NSHostingView(rootView: ZStack { Color.clear HStack { Text("Hey") …
Vadim
  • 9,383
  • 7
  • 36
  • 58
7
votes
2 answers

How to detect active appearance for NSView or for its parent NSWindow?

All native controls have different appearance when their parent window is active or inactive. How should we check this state in custom components e.g. while rendering a button cell? We could inspect controlView.window’s properties like isMainWindow…
Vadim
  • 9,383
  • 7
  • 36
  • 58