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
20
votes
6 answers

How do I disable the Show Tab Bar menu option in Sierra apps?

I've got an app that uses a Toolbar in a NSWindow. I don't want users to be able to customize this toolbar for aesthetic reasons. In Sierra there's a new Menu option that gets inserted into "Menu > View" called Show Tab Bar. How do I disable this?…
strangetimes
  • 4,953
  • 1
  • 34
  • 62
19
votes
6 answers

mouseMoved not called

I have a subclassed NSView which is part of a .xib-file of a subclassed NSDocument, which gets alive by the default behaviour of NSDocumentController's openDocument: method. In this subclassed NSView I have implemented the methods awakeFromNib, in…
Dominik Seibold
  • 2,439
  • 1
  • 23
  • 29
19
votes
6 answers

Keep NSWindow front

I open a NSWindow from my main NSWindow. DropHereWindowController *dropHereWindowController = [[DropHereWindowController alloc] initWithWindowNibName:@"DropHereWindow"]; [dropHereWindowController showWindow:nil]; I want this window to stay on top…
user661577
  • 201
  • 1
  • 2
  • 5
19
votes
1 answer

How to get notified when NSWindow closes

how can I take notice when an NSWindow should or will get closed? I'd like to have something like the windowWillClose. Unfortunately NSWindowController does not have as much convenient methods as UIViewController has, for example. So what's the best…
flohei
  • 5,248
  • 10
  • 36
  • 61
19
votes
2 answers

Programmatically create NSWindow

I want to programmatically create a new NSWindow, but I can't find a way to succeed. This simple code doesn't display a new window. What's wrong with it? @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var…
user3345978
  • 201
  • 1
  • 2
  • 4
19
votes
3 answers

How to add an NSView to NSWindow in a Cocoa app?

Since the template of an OS X app in Xcode seems to be similar to an empty app template, the following is used to add a view and a button (trying not to use Interface builder for now): - (void)applicationDidFinishLaunching:(NSNotification…
Jeremy L
  • 3,770
  • 6
  • 41
  • 62
18
votes
4 answers

Mac OS X Lion: Detect if another application is running in full screen mode?

In a Cocoa app, is there a way to tell if another application currently is in full screen mode? My application is configured to show up on all Spaces and listens for mouseEntered events to order itself to the front. Problem is that when another app…
Mark
  • 6,647
  • 1
  • 45
  • 88
18
votes
6 answers

Set Window Resizable

In IB this can be done easily by checking the 'Resize' checkbox on or off. My problem is I want my main NSWindow to not be resizable, until a button is clicked, and then i want it to be resizable. I've scoured the Internet but can't find anything?…
Cristian
  • 6,765
  • 7
  • 43
  • 64
17
votes
1 answer

Converting an NSPoint from window coordinates to view coordinates

My application has a custom view that displays a timeline of events. This view is wrapped in an NSScrollView to support horizontal scrolling of the timeline. Using notifications, I've implemented a mechanism that should show another custom view…
Roger
  • 4,737
  • 4
  • 43
  • 68
16
votes
2 answers

Resize NSWindows with easing animation

I'm trying to resize an NSWindow (the main one) with a nice easing animation (EaseOut). I can use the [NSWindow animator] but I havn't found a way to add the easing effect. Do you have an idea or code sample which can help me to do that?
kaal101
  • 654
  • 7
  • 14
16
votes
1 answer

NSWindow: Passing mouse events through window to whatever is underneath

Is it possible to pass mouse events through an NSWindow to whatever is behind it (even if it is a window from another application)? I am using NSWindow to create a desktop overlay, but would like to still be able to interact with other windows, even…
carloe
  • 1,440
  • 3
  • 18
  • 26
16
votes
3 answers

How do I get default title bar height of a NSWindow?

I created an OS/X app that when it runs, I position the window in the center of the screen. In order to do this, it's essential that I include the title bar height in my calculation of the y value. Is there a way to determine the default title bar?…
Suppy
  • 161
  • 1
  • 1
  • 5
16
votes
2 answers

How do you use the dark vibrancy on an NSWindow?

What is the correct way to use the Vibrant Dark (NSAppearanceNameVibrantDark) or Vibrant Light (NSAppearanceNameVibrantLight) modes with an NSWindow? I'm building an application and would like to offer the new Vibrant Dark appearance as an option…
kennyc
  • 5,490
  • 5
  • 34
  • 57
15
votes
4 answers

NSWindow contentView not cover full window size - macOS & SwiftUI

I'm starting a new macOS app with SwiftUI but I have a big problem. The app needs a full size contentView (underneath titleBar) but I can't accomplish. On a new project using Storyboards works fine, but with SwiftUI not. My code: Result: And it…
mhergon
  • 1,688
  • 1
  • 18
  • 39
15
votes
5 answers

Non-resizable window swift

I have a NSViewController named Hardness, and I need not to let user resize it. Of course, I can just resize it back every time the users tries, but is there any way just not to let user open a window to full screen, or to stretch the window?
pomo_mondreganto
  • 2,028
  • 2
  • 28
  • 56
1
2
3
88 89