The NSPanel class implements a special kind of window (known as a panel), typically performing an auxiliary function.
Questions tagged [nspanel]
92 questions
1
vote
1 answer
Cocoa: Close the app when a HUD panel is closed
I need to close the entire app when the user click on a Panel close button,
I tried:
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication {
return YES;
}
but it closes the app also from file-selector…

fntlnz
- 411
- 2
- 6
- 14
1
vote
2 answers
How to avoid deallocating a NSPanel when closed by the user
I am developing a small and simple status menu application.
There is a menu and when the user clicks on it, a HUD window (NSPanel) should appear.
This is how I show the panel:
[hudWindow makeKeyAndOrderFront: self];
This is how I dismiss the…

Ramy Al Zuhouri
- 21,580
- 26
- 105
- 187
1
vote
1 answer
NSPanel has black background and text is invisible
I'm trying to make a configure sheet appear for a ScreenSaverView subclass. After a long battle with Xcode, I'm finally getting the configure sheet to appear when "Screen Saver Options" is clicked in System Preferences (and my screen saver is…

JacobEvelyn
- 3,901
- 1
- 40
- 51
1
vote
1 answer
Switching NSWindows
I have two NSWindows, both with an NSPanel in them. I want to switch windows when a button is pressed. How can this be done? I don't need the old window any more so I just want to show the new one.

James Anderson
- 556
- 3
- 16
- 41
1
vote
1 answer
Is it possible to have focus on an NSPanel without losing focus of other background windows?
I have a custom NSPanel: http://cl.ly/K8SY
I have it set to NSPopUpMenuWindowLevel, the level at which I want it to stay as. An example is the spotlight menu, when you click on it any other focus in the windows in the background remains yet you can…

Luke
- 4,908
- 1
- 37
- 59
1
vote
2 answers
Can't hide NSFontPanel on application launch
I'm creating a feature for my application where I want to use the NSFontPanel.
I don't want to have a "Font" menu in my application.
Opening and closing the font panel when a menu item is clicked is done like that
- (IBAction)…

guitarflow
- 2,930
- 25
- 38
1
vote
0 answers
Is this panel brought up correctly?
I'm running xcode 4.2 on Snow Leopard. I am trying to bring up a panel in a Mac application that will display alongside the main window. Here's the code for that:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
…

David U
- 943
- 1
- 8
- 22
0
votes
1 answer
NSPanel loses focus although being modal
I have a strange problem with one of my NSPanels. Starting up my application, I use a simple panel with only an NSTextField and an NSButton to get the player's name. Working on some other stuff on my application, all of a sudden the panel does not…

Living Skull
- 126
- 6
0
votes
1 answer
Display a sheet but still let my main app do work
The loadFile method starts a NSTimer to load an process a file over time without blocking the application in a while loop. This timer is not firing with the first bit of code, and is with the second bit. The issue is the second bit shows the sheet…

Justin808
- 20,859
- 46
- 160
- 265
0
votes
1 answer
NSPanel Popping up in the wrong space
So, I'm looking through this source, trying to make one of those status bar applications with a custom popover using an NSPanel -
All works fine and dandy. Clicking the menulet calls [panel makeKeyandOrderFront:nil] which works in most cases - the…

Vervious
- 5,559
- 3
- 38
- 57
0
votes
1 answer
Custom Sheet : can't click buttons
I used this source http://www.cats.rwth-aachen.de/library/programming/cocoa
to create my custom sheet.
I created a NSPanel object in existing .xib file and connected with IBOutlet
My source code:
.h
@interface MainDreamer : NSWindow…

Ilya Blokh
- 11,923
- 11
- 52
- 84
0
votes
0 answers
How do I keep key focus on both NSPanel and background app?
currently I'm using activate and makeKeyAndOrderFront to "show" and focus a TextEditor on my NSPanel when I pressing a hotkey. However this steals the input focus from other apps. How should I go about also maintaining the input focus from…
0
votes
0 answers
How to make a window behave like an input method or spotlight
How can I make a panel behave like e.g. Spotlight
or the input method
such that
the window does not activate the app
the window does close editors of other windows
the window receives keyboard input
closing/hiding the window does not hide the…

ManuelSchneid3r
- 15,850
- 12
- 65
- 103
0
votes
0 answers
CASpringAnimation start from 0.0 anchorpoint of NSView
I'm trying to make a animation for NSView of NotchPanelby use CASpringAnimation
but the animation always start from 0.0 anchorpoint
Is it possible to change contentView anchorpoint? how can I change the animation to start from center of my…

Avi Rok
- 550
- 1
- 4
- 7
0
votes
0 answers
Make macOS window capture hover events even if set _setPreventsActivation:true and canBecomeKeyWindow:true
I want to achieve a certain window behavior for a macOS app. I subclassed NSWindow to be able to add additional properties. So far, it works well with almost all requirements (dragging it, clicking buttons) while preserving the core requirement of…