The NSPanel class implements a special kind of window (known as a panel), typically performing an auxiliary function.
Questions tagged [nspanel]
92 questions
0
votes
0 answers
Keep window in focus always in swift Cocoa
I'm currently working on a "floating" window. The window contains a tableview with clickable rows.
var myPanel = NSPanel()
func mClipboardConfig(){
mtPanel = NSPanel(contentRect: CGRect(x: 100, y: 100, width: 50, height: 200), styleMask:…

unknown
- 788
- 9
- 24
0
votes
0 answers
NSPanel initializing in the style of NSWindow using PyObjC
I downloaded one of the example codes from the PyObjC Documentation and stripped it down of most of its non-essential contents. I then changed all references of NSWindow to NSPanel, but this had no effect.
from Cocoa import NSObject, NSApplication,…

Yassine Elshayeb
- 44
- 7
0
votes
1 answer
NSPanel borderless but always on top
I am trying to make a NSPanel that looks like this
This is initialized like that
let panel1 = NSPanel(contentRect: frame1,
styleMask: [.borderless],
backing: .buffered,
…

Martin Mlostek
- 2,755
- 1
- 28
- 57
0
votes
1 answer
Editable NSTextField inside not .titled NSPanel
I'm making a bridge for react-native-macos. I need NSPanel with the same behaviour as Spotlight.
I programmatically created NSPanel and NSTextField inside. Everything working as expected, but if I change NSPanel to not .titled - the text field is…

Denis
- 17
- 3
0
votes
2 answers
Make NSPanel always on top
I'm making a bridge for react-native-macos. I need NSPanel with the same behaviour as Spotlight.
I programmatically created it, but have questions:
Can't make it always on top (also it should work if app is hidden)
There is NSTextField inside the…

Denis
- 17
- 3
0
votes
1 answer
Initializing Controls in NSPanel
I've got an NSPanel in my app that I use as a data export feature.
How do I initialize the controls in the panel when it's initially displayed? (i.e. using NSDefaults). There doesn't seem to be an event that fires when the window/panel opens where I…

Stuart Tevendale
- 614
- 6
- 19
0
votes
1 answer
In Catalina, `orderFront:` causes app to become the active application; how do I prevent this?
I have a background "monitoring" app that runs either as an accessory or as a regular app (user choice depending on whether they want to see it in the dock).
The app has several never-key utility windows (NSPanels) that display the progress of…

James Bucanek
- 3,299
- 3
- 14
- 30
0
votes
1 answer
How do I get keyboard events in the topmost NSPanel?
I have created an app using Xamarin to help watching movies online. It shows the subtitles on top of all other windows. This has been done using the NSPanel, as it was the only way to make it work on MacOS Mojave.
The app works well. Now I want to…

wave-rider
- 31
- 5
0
votes
1 answer
Can't select rows in an NSTableView in Service app
I'm literally going nuts.
I have a service app that opens a pretty simple NSPanel that consists of an NSTableView, a label, and three NSButton controls.
That's it.
The table view is view-based, and has four different NSTableCellView rows defined in…

James Bucanek
- 3,299
- 3
- 14
- 30
0
votes
1 answer
Why does my app crash when an NSPanel is closed by pressing Escape?
I have an NSPanel in my app that is crashing the app (EXC_BAD_ACCESS in main()) whenever it is closed by pressing the Escape key. Closing it any other way (File > Close, Cmd-W, clicking the red close button) works fine.
The panel is shown by…

fbitterlich
- 882
- 7
- 24
0
votes
0 answers
How to implement a pop-up window when hovering on a URL link
I'm relatively new to Cocoa application. In my application (MacOS), I already mark the text if it contains image url link. What I'm trying doing now is that when the mouse hover (without clicking) on the link, the application will open an NSPanel…

user2131907
- 342
- 1
- 6
- 14
0
votes
1 answer
Sheets and long running tasks
I need to run a complex (ie long) task after the user clicks on a button.
The button opens a sheet and the long running operation is started using dispatch_async and other Grand Central Dispatch stuff.
I've written the code and it works fine but I…

dafi
- 3,492
- 2
- 28
- 51
0
votes
0 answers
Auxiliary NSPanel changes the color of the parent window's toolbar separator
When I have an NSWindow with a toolbar and an auxiliary NSPanel, then the main window's toolbar separator becomes black when the panel is made key :
You can find an example project here.
Why does this occur? All is fine if I use an NSWindow…

Bruno Vandekerkhove
- 381
- 2
- 13
0
votes
0 answers
NSSavePanel moves position when clicked
My NSSavePanel is behaving strangely. Whenever I click on it (any area that normally allows you to drag the window around), it moves down the screen a few pixels. This only happens when I click on empty space like the large empty area of the…

yesthisisjoe
- 1,987
- 2
- 16
- 32
0
votes
1 answer
Use NSPanel for user input. Not opening up again
I want to display a 'NSPanel' for the user to input a name for a new folder. Why a NSPanel? Because it looks awesome! It hosts one TextField and one PushButton to confirm the name. It shall also close the window when clicked.
It displays when the…

user57213
- 5
- 5