The NSPanel class implements a special kind of window (known as a panel), typically performing an auxiliary function.
Questions tagged [nspanel]
92 questions
4
votes
1 answer
NSWindow / NSPanel can't show in front of full-screen application
In my app, there is a utility window (actually it is a NSPanel object). It would show up sometime and be in front of other application's window.
But when other application runs in full-screen mode, the utility window doesn't show. But I found that…

Gon
- 1,135
- 12
- 22
4
votes
0 answers
Unable to resize NSPanel after initial sizing
I want to resize an NSPanel when a user dismisses an item. I can initially size it perfectly:
[super awakeFromNib];
_mustNotAutoSize=FALSE;
// Make a fully skinned panel
NSPanel *panel = (id)[self window];
[panel…

JeremyLaurenson
- 979
- 2
- 11
- 23
4
votes
1 answer
How to create a NSPanel modally popuped from NSWindow (Cocoa programming)
like NSPanel displayed after a button clicked in the NSWindow.
I looked for a lot but there is no simple example.
Thanks for any help.

droughtrain
- 257
- 1
- 4
- 18
4
votes
3 answers
How to stop modal with close button in NSWindowController?
I want to stop modal when the user clicks the red close button in NSWindowController.
In the NSWindowController, there are "OK" and "Cancel" buttons.
- (IBAction)okButtonClicked:(id)sender
{
[NSApp stopModalWithCode:NSOKButton];
[self.window…

Yun
- 5,233
- 4
- 21
- 38
4
votes
1 answer
Why my NSPanel doesn't have background of gray color as normal?
My app has an icon in the menubar. A NSPanel shows up when I click the icon. But why does the NSPanel not have a background color like other having gray background NSWindow? My NSPanel's background looks like transparent. My NSPanel comes from a…

gohamgx
- 273
- 2
- 16
4
votes
2 answers
Prevent Escape key from closing an NSPanel with a close box
Does anyone know the best way to prevent an escape key from closing an NSPanel when it's the key window? My panel is a child window and I want it to behave a little more like semi-permanent part of the window, more like a drawer, and for the text…

Pierre Houston
- 1,631
- 20
- 33
3
votes
0 answers
Make NSWindow remain "float" when space changes in swift
I currently have:
let window = NSWindow(contentRect: NSRect(x: 300, y: 300, width: 200, height: 200), styleMask: [.borderless], backing: .buffered, defer: true)
window.backgroundColor = NSColor.green
window.level = .floating
…

unknown
- 788
- 9
- 24
3
votes
2 answers
EXC_BAD_ACCESS invoking a block
UPDATE | I've uploaded a sample project using the panel and crashing here: http://w3style.co.uk/~d11wtq/BlocksCrash.tar.gz (I know the "Choose..." button does nothing, I've not implemented it yet).
UPDATE 2 | Just discovered I don't even have to…

d11wtq
- 34,788
- 19
- 120
- 195
2
votes
1 answer
NSPanel not hiding when focus is lost
I am trying to create a window like Spotlight.
As in Spotlight it should hide when the background is clicked. I tried doing it unsuccessfully with NSWindow but I was lead to believe using NSPanel instead would solve the problem.
However, even when…

Ibrahim99
- 339
- 1
- 3
- 9
2
votes
0 answers
How do I refer to an object in a window whose Accessibility Inspector description is “ (sheet) [NSPanel]” in Applescript?
Image of my accessibility inspector
I am writing a script that will run a microsoft office installation DMG and click continue and so on and on until the program is installed. I have been successful in navigating the buttons I need to press until I…

haibert
- 111
- 5
2
votes
1 answer
Moving NSPanel by background with some NSViews on it
I have a NSPanel. When the panel is empty, is moves well with holding and dragging it's background. However, If I put something on it, the area covered by new view won't be draggable anymore. As an example, I could put a NSImageView fills the panel…

eonil
- 83,476
- 81
- 317
- 516
2
votes
2 answers
windowNumbersWithOptions: on Yosemite fails to return NSPanel windows of my application
I have a document-based application, with a main document window and several "satellite" NSPanel windows showing related info. They are not floating, they can (and do) become key, and seem to be at the same layer as the main window.
I try to…

Motti Shneor
- 2,095
- 1
- 18
- 24
2
votes
1 answer
Creating a sheet that doesn't block interaction with other windows
As far as I know, sheets modal for a certain window without "freezing" the app can only be NSSavePanels, NSOpenPanels, and NSAlerts windows (since NSAlert isn't a NSWindow or NSPanel subclass but it has an associated window); if I wanted a generic…

user732274
- 1,069
- 1
- 12
- 28
2
votes
1 answer
Is it possible to turn NSNonactivatingPanelMask on and off on an NSPanel
I understand that this use case is atypical, but I've been trying to figure out a way to make an NSPanel non-activating, only in some circumstances.
If an NSPanel is initialized with NSNonactivatingPanelMask (or if the "Non Activating" property of…

mliberatore
- 341
- 1
- 10
2
votes
2 answers
In Interface builder, how can I add a custom button to a window title bar?
In my OS X app, using Interface Builder, I have a window that looks like this:
I'd like to add a button to the right-hand side, to achieve this:
If this is possible, how can I do it?

Steve McLeod
- 51,737
- 47
- 128
- 184