Questions tagged [nspopover]

NSPopover is a Cocoa control to temporarily show additional info in a popup like window that automatically disappears for user actions not related to the popover.

The NSPopover class was added in OS X 10.7 for tasks like events in the calendar app (see year overview). Apple's documention for the class is here: NSPopover Class Reference.

216 questions
20
votes
8 answers

Not being able to edit NSTextField on NSPopover even though Editable behavior is set

I have an application, which open popover with NSTextField. The text field is not editable. Behavior for text field is set to Editable. I still can paste and copy text to this field but i can't edit it. Anyone knows, what can be wrong?
agent-10
  • 361
  • 2
  • 9
19
votes
4 answers

NSPopover - Hide when focus lost? (clicked outside of popover)

I'm using the doubleClickAction of a NSTableView to display a NSPopover. Something like this: NSInteger selectedRow = [dataTableView clickedRow]; NSInteger selectedColumn = [dataTableView clickedColumn]; // If something was not selected, then we…
Kyle
  • 17,317
  • 32
  • 140
  • 246
14
votes
1 answer

How to make action to close NSPopover?

Hi I implemented an NSPopover in one of my apps, but the popover will not close. I'm guessing that it should close once I click something else, but its not. I know that there's a close popover action but that only works for a different button. How…
sridvijay
  • 1,526
  • 18
  • 39
13
votes
3 answers

Using an NSNumberFormatter in an NSPopover

Is there any way to get an NSNumberFormatter (or presumably any other NSFormatter) to work in an NSPopover? The NSTextField's value in the popover is bound to an NSViewController's representedObject. When an invalid number is entered into the field…
chockenberry
  • 7,811
  • 5
  • 32
  • 41
12
votes
4 answers

How do I prevent the menu bar from moving down when my popover is open?

I have an app with a popover that appears on a status bar item. The thing is, when you click on the icon while you're in a full screen app, then move the mouse away from the menu bar to click on something in the popup, the menu bar moves up, and so…
tbodt
  • 16,609
  • 6
  • 58
  • 83
10
votes
1 answer

How to create NSPopover programmatically

i've didn't found some examples to create NSPopover dynamically instead using the Interface Builder. Following code gives an exception, loaded nib, but no view is set: NSViewController *controller = [[NSViewController alloc] initWithNibName:@"View" …
martin
  • 125
  • 1
  • 1
  • 7
10
votes
0 answers

How do automatically resize an NSPopover with auto layout

I currently have an NSPopover subclass which sets it content view controller to a custom NSViewController meant to represent a tab view: self.popover.contentViewController = tabViewController; self.popover.animates = YES; I'm rolling my own…
JPC
  • 8,096
  • 22
  • 77
  • 110
10
votes
1 answer

Transparent background of NSTextfield NSPopover

Disclaimer: This question is an extension to this question I am trying to populate a Table in NSPopover.(As seen in the image) Problem: I am not able to make transparent background to NSTextField. Strangely, it works fine if view is attached…
Kaunteya
  • 3,107
  • 1
  • 35
  • 66
9
votes
7 answers

NSPopover color

Is there any way to color NSPopover? Ive seen apps like facetab etc that have cool colors and resizeable popovers, how is this done? Ay guides, hints? Thanks.
Rasmus Styrk
  • 1,296
  • 2
  • 20
  • 36
9
votes
2 answers

NSPopover to start in a detached state

Is there a way to force the NSPopover to start in the detached state? I only see isDetached which is a read-only property for the state of the popover and an NSPopoverDelegate method detachableWindow(forPopover:) which lets me override the window…
Kirkova
  • 319
  • 1
  • 9
9
votes
1 answer

3 or more *consecutive* layout passes to prepare to be shown. Error

When I open an NSPopover I am getting the following error: WARNING: needed 3 or more *consecutive* layout passes to prepare to be shown. Verify that nothing in your view hierarchy is aggressively dirtying layout during…
GeoffCoope
  • 952
  • 9
  • 20
8
votes
1 answer

Getting access to NSPopover window to set level?

When a popover shows, I'm curious whether it's possible to set the underlying settings on the popover's window, such as the window level. In my testing, popovers seem to be a window, but they doesn't respond to normal NSWindow selectors, such as…
sudo rm -rf
  • 29,408
  • 19
  • 102
  • 161
8
votes
3 answers

NSTextField keep focus/first responder after NSPopover

The object of this app is to ensure the user has entered a certain text in an NSTextField. If that text is not in the field, they should not be allowed to leave the field. Given a macOS app with a subclass text field, a button and another generic…
Jay
  • 34,438
  • 18
  • 52
  • 81
8
votes
2 answers

How to open a NSPopover at a distance from the system bar?

I'm opening a NSPopover with the action of an icon in the status bar. myPopover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY) This works fine with the exception that the distance from the popover and the system bar is…
Pier
  • 10,298
  • 17
  • 67
  • 113
8
votes
3 answers

How do I make a Menu Bar (NSPopover) App active when clicking on the menu button?

I have an app that sits in the menu bar, and when you click on the button it presents an NSPopover. That all works fine, but I want an NSSearchField to become the first responder, so a user can then type straight in the box. However, if the app was…
Christopher Hannah
  • 1,718
  • 2
  • 14
  • 23
1
2 3
14 15