Questions tagged [nspanel]

The NSPanel class implements a special kind of window (known as a panel), typically performing an auxiliary function.

nspanel
Filter by
Sorted by
Tagged with
31 votes
1 answer
7k views

Tips on NSApp’s ModalForWindow, NSAlert’s ModalForWindow, and ModalSession [closed]

It took me quite a bit of experimentation to clear up some confusion over Objective-C’s “ModalForWindow” language and, subsequently, how to use a modal session. Maybe the following tips will save ...
Wienke's user avatar
  • 3,733
15 votes
3 answers
5k views

Allow an NSWindow (NSPanel) to float above full screen apps

I'm trying to add a little window that provides "quick input" from any place in the system to the main app. The user could hit a hotkey, the window pops up, and floats above all other windows. For ...
radex's user avatar
  • 6,446
14 votes
1 answer
1k views

NSPanel in "Non-Activating"-Mode does not always show correct cursors

I've created a simple Cocoa-Application in XCode 4.6 with an NSPanel instead of the default NSWindow. When I enable the Non-Activating option and start the application everything works fine: The ...
jimmyorpheus's user avatar
7 votes
2 answers
16k views

set NSWindow focused

I have an app winth one window and one panel, attached to this window. steps: deactivate my app (app opened, but without the focus) click on a button on panel (panel is focused now, but main window ...
BUDDAx2's user avatar
  • 399
7 votes
4 answers
1k views

Prevent activating the application when clicking on NSWindow/NSView

I'm working on a screenshot Mac app. I'm trying to rebuilt what happens when you press Cmd-Ctrl-Shift-4: the cross hair cursor and the selection rectangle for the screenshot. I'm using a custom ...
Mark's user avatar
  • 6,807
7 votes
2 answers
1k views

NSPanel with "Title Bar" unchecked in Interface Builder does not appear

So I thought I had covered my bases, but apparently I'm missing a key step or two. I have an NSPanel that is displayed (makeKeyAndOrderFront:) when an NSStatusItem is pressed. Things work great, but ...
Craig Otis's user avatar
  • 31.6k
6 votes
1 answer
9k views

How to Convert NSURL to CFURLRef

Apple gives sample code for Creating PDF document. But It uses CFURLRef NSPanel savepanel gives NSURL. I can't convert NSURL to CFURLRef path = CFStringCreateWithCString (NULL, filename, ...
codezero's user avatar
6 votes
1 answer
4k views

Create a HUD window programmatically

I need to create a HUD-like window programmatically when the user press on my main view. Here's the code I use, but I only get a standard window. videoWindow= [[NSPanel alloc] ...
user avatar
5 votes
3 answers
7k views

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 { [...
Yun's user avatar
  • 5,373
5 votes
1 answer
3k views

Make NSView in NSPanel first responder without key window status

Is it possible to give an NSView inside an NSPanel first responder status without giving the NSPanel key window status (making the main application window resign key)? Thanks.
indragie's user avatar
  • 18.1k
4 votes
1 answer
1k views

NSPanel removed in Xcode 8?

In the past I can find Panel available in Interface Builder's Library, but in Xcode 8, I searched the whole library in storyboard editor, no Panel available. Has Apple just removed NSPanel or I got ...
Xiao Xiao's user avatar
  • 931
4 votes
1 answer
8k views

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's user avatar
4 votes
2 answers
407 views

Tabs in iWork-style Inspector panel

how does one get the look of the tab buttons as they appear in iWork '09 Inspector NSPanel? Closest I could get is NSSegmentedControl with "Small Square" style. Unfortunately, at least under Snow ...
Ivan Vučica's user avatar
  • 9,619
4 votes
1 answer
331 views

How can I make an OS X application unfocusable while still receiving click events?

I'm developing an on screen keyboard application for OS X, similar to the one that's built in to the operating system (Keyboard Viewer). I seem to have hit a wall as I'm not sure how I can accept ...
rthor's user avatar
  • 128
4 votes
2 answers
655 views

NSSavePanel crashes on Yosemite

I am using NSSavePanel to save image. I have used IKSaveOption which gets added to the NSSavePanel. When save panel tries to open the sheet for window it crashes saying - *** Assertion failure in ...
user3699036's user avatar
4 votes
1 answer
1k views

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, ...
Gon's user avatar
  • 1,135
4 votes
1 answer
497 views

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 ...
gohamgx's user avatar
  • 273
4 votes
2 answers
1k views

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 ...
Pierre Houston's user avatar
4 votes
1 answer
447 views

Is it possible to use the blur behind Core Animation(effect) on an NSPanel?

The context menu from dock items is not only translucent but also blurs the contents behind it, Is this effect availible for translucent floating panels? This is the same effect used in Sheet Alert ...
Jared Zimmerman's user avatar
4 votes
1 answer
314 views

How to make resize cursors show up for a floating non-activating panel?

I have a floating NSPanel that is non-activating, i.e. its styleMask contains the NSNonactivatingPanelMask flag. Since this panel never becomes active, the system does not show the usual resize ...
Florian Kugler's user avatar
4 votes
0 answers
342 views

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)[...
JeremyLaurenson's user avatar
3 votes
2 answers
6k views

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). ...
d11wtq's user avatar
  • 35k
3 votes
0 answers
308 views

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 = ...
unknown's user avatar
  • 898
2 votes
2 answers
1k views

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's user avatar
  • 52.1k
2 votes
1 answer
510 views

about panel in menubar application is not frontmost when activated

I have an application that lives in the menubar, without a main menu or dock icon. I have a button that triggers [NSApp orderFrontStandardAboutPanel:sender];. When that button is clicked, sometimes, ...
rick's user avatar
  • 1,085
2 votes
1 answer
537 views

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 ...
Ibrahim99's user avatar
  • 359
2 votes
2 answers
1k views

Cocoa: NSPanel loses parent and other strange behaviour

I have an issue with an NSPanel acting strangely and have created a Sample App to demonstrate this behaviour. The App was generated from Xcode 4's template and simply creates a panel and then opens ...
trojanfoe's user avatar
  • 121k
2 votes
2 answers
382 views

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 ...
Motti Shneor's user avatar
  • 2,153
2 votes
0 answers
296 views

How do I refer to an object in a window whose Accessibility Inspector description is “<empty description> (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 ...
haibert's user avatar
  • 111
2 votes
1 answer
405 views

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 ...
user732274's user avatar
  • 1,069
2 votes
1 answer
550 views

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 ...
mliberatore's user avatar
2 votes
1 answer
246 views

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 ...
eonil's user avatar
  • 84.8k
1 vote
1 answer
2k views

How to tell when NSPanel gets focus or becomes key?

I am writing a Cocoa/Objective-C app in XCode4, and I need to know when my preferences panel is opened. I need some callback like windowDidBecomeKey; I attempted to follow the solution provided in ...
WilHall's user avatar
  • 11.8k
1 vote
3 answers
2k views

HUD NSPanel less transparent

I've been searching for the web but I have not encountered the way to change the HUD's transparency (ALL the panel transparency, including title bar). It's possible to change it? Thx
Andreu's user avatar
  • 11
1 vote
2 answers
5k views

How to create a float window floating above all other windows just like twitter?

The twitter app has a float window when you click the contextual menu "Tweet",is it a NSPanel? How to?
NeXT5tep's user avatar
  • 871
1 vote
2 answers
470 views

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 ...
guitarflow's user avatar
  • 2,970
1 vote
1 answer
370 views

Changing the titlebar height in an NSPanel

I'm trying to change the titlebar height of an NSPanel. I tried the following but it didn't work as expected: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSRect f = [[[...
Larry's user avatar
  • 397
1 vote
1 answer
199 views

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 ...
fntlnz's user avatar
  • 411
1 vote
2 answers
651 views

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 ...
Ramy Al Zuhouri's user avatar
1 vote
1 answer
581 views

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 ...
JacobEvelyn's user avatar
  • 3,951
1 vote
2 answers
990 views

MacOS: how to get NSPanel to resist key focus (with becomesKeyOnlyIfNeeded?)

In MacOS/Cocoa/Swift 4.2/Xcode 10.1 I’m trying to create an NSPanel that floats over my document window as a lightweight markup palette that interacts with a (primarily keyboard-based) editing session ...
Nicholas Jackiw's user avatar
1 vote
1 answer
406 views

How to detect when a NSPanel closes as a result of losing focus? E.g. A user clicking outside of the NSPanel (Window?)

I have a generic NSPanel window that I am using as a preferences window in my app. I have a selector that I call every time the window closes. The purpose of that selector is to save the state of the ...
skålfyfan's user avatar
  • 5,071
1 vote
1 answer
655 views

How to implement my own pop-up control in Cocoa?

I want to make a custom autocomplete control for my NSWindow, sort of like Xcode's fancy one, but I can't quite figure out how. I made an NSPanel with its own NSWindowController, and I display it ...
user241221's user avatar
1 vote
1 answer
1k views

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 ...
Luke's user avatar
  • 4,986
1 vote
0 answers
79 views

Reproduce the exact background effect of macOS control center items in the status bar

I am trying to reproduce the background blur/color effect that is used by macOS Control Center items such as Wifi, Sound, Battery, etc, that can be found in the status bar. Normally to achieve this ...
Sake's user avatar
  • 635
1 vote
1 answer
155 views

NSVisualEffectView not applying intended "frosting" effect

Modern applications increasingly often use the typical "frosting" effect for their window backgrounds. Such an effect usually consists of a combination of blurring and playing with the ...
linus_hologram's user avatar
1 vote
0 answers
127 views

NSSavePanel appears differently between applications, even with identical code

I was having trouble with an NSSavePanel in my project, so to try to isolate the problem, I created a test project that included only the NSSavePanel code in the default window's viewDidLoad. Test ...
yesthisisjoe's user avatar
  • 2,007
1 vote
0 answers
94 views

Cannot paste text inside menu item's popup panel

I have a menu application and I'm launching a NSPanel from a menu item: when the user clicks on the menu item I lazily instantiate a custom NSWindowController (just the first time), and then I show it ...
Ramy Al Zuhouri's user avatar
1 vote
1 answer
265 views

NSPanel causes subsequent use of NSOpenPanel to generate an exception

I have an app that uses a NSOpenPanel so that the user can select multiple files for import and also has a typical preferences panel. The prefs panel is stored in the .xib file. A problem occurs ...
Todd's user avatar
  • 1,839
1 vote
0 answers
96 views

NSTableView reload in NSPanel (not main window)

From my main window i open a NSPanel in the second screen and in content view i have a NSTableView. On reloadData the TableView make the refresh but on screen the data didn't refresh. I have to make ...
boompa's user avatar
  • 61