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
2
votes
3 answers

NSPopover custom animation

Is there any way to create a custom animation for NSPopover? I can switch off the animation by using the animates property, however since NSPopover is a subclass of NSResponder and not a proper view or window I can't figure out how to animate it…
firstresponder
  • 5,000
  • 8
  • 32
  • 38
2
votes
1 answer

NSPopover: Class Unavailable (NSPopover on Mac OS X versions prior to 10.7)

I want to update my App and switch to Lion only, since I'm using the new NSPopover class. I set my deployment target and the base SDK to 10.7 but I'm still getting the error message: NSPopover: Class Unavailable (NSPopover on Mac OS X versions…
tamasgal
  • 24,826
  • 18
  • 96
  • 135
2
votes
0 answers

NSTextField in NSPopOver beeping instead of sending action to target (document)

I have a document-based Cocoa (Mac)/Objective-C application. I'm showing a popover on one of the views in my document window's view; the popover contains only an NSTextField, whose target is the first responder (I have also tried wiring it directly…
Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
2
votes
0 answers

Override NSWindow of NSPopover

Is it possible to override the NSWindow of an NSPopover? You can get the window with let window = mypopover.contentViewController.view.window but it seems nowhere present when subclassing NSPopover. Where is it? Background: Need to lift Screen…
flymg
  • 549
  • 3
  • 19
2
votes
1 answer

NSPopover in NSCollectionView (or not)

I have a custom subclass of NSView that is used in an NSCollectionView. The view shows a NSPopover when it is double clicked using the code below: - (void)mouseDown:(NSEvent *)theEvent { [super mouseDown:theEvent]; if ([theEvent clickCount]…
spudwaffle
  • 2,905
  • 1
  • 22
  • 29
2
votes
2 answers

Swift macOS popover detect change dark mode

I have a popover as seen from the image. I have to make sure that when the screen mode changes, dark mode or light mode, the color of the popover changes. The color is taken from the asset, like this: NSColor(named:…
Paul
  • 3,644
  • 9
  • 47
  • 113
2
votes
0 answers

How to use “Look Up in Dictionary” in NSPopover Swift

I'm building my macOS app that contains NSPopover with NSTextView inside. If "Look up & data detectors" is active at system preferences, NSTextView will support this functionality without any additional settings. But in case, when you place…
2
votes
0 answers

Prevent NSPopover from clipping offscreen - Swift 5

I'm currently developing a MacOS menubar app and my NSPopover is fairly wide (450 pixels). Because of its width, it clips off screen if the user doesn't have other MenuBar Items taking space (See image below for visual example). Here's my code for…
Jeremy
  • 21
  • 2
2
votes
1 answer

addCursorRect fails on NSButton after NSPopover loses focus

I have a NSPopover that contains two buttons. When I open the popover, the following code works to change the cursor to a pointing hand when hovering over the buttons and on clicking the button, 'Button pressed' appears in the console and an…
user11145365
  • 184
  • 9
2
votes
1 answer

Programaticly dismiss popover in SwifUI

I try to dismiss a popover with setting the variable, that shows it to false. The sample code behaves quite strange. Is there a better way to dismiss the popover programaticly with the Cancel Button? import SwiftUI struct ContentView: View { let…
mica
  • 3,898
  • 4
  • 34
  • 62
2
votes
0 answers

Resizing NSPopover flickers in 10.14

I have a popover which i want to resize the popover whenever click action performed. In viewDidLayout using preferredContentSize i am resizing the popover - (void)viewDidLayout { self.preferredContentSize = NSMakeSize(NSWidth(tableview.frame),…
zack
  • 137
  • 12
2
votes
1 answer

NSPopover Background Color (Including Triangle) with macOS Mojave Dark Mode

Swift 4.2, Xcode 10, macOS 10.14 I have created the following NSView subclass that I put on the root view of all my NSPopover instances in my storyboard. But I noticed that when I switch the color mode in macOS Mojave (from dark to light or the…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
2
votes
0 answers

NSPopover changes origin when changing height

I'm trying to resize my popover by increasing/decreasing its content size programmatically popover.contentSize.height += 10 and it's ok when macOS menubar is shown. But when menubar is hidden popover changes its resizing behavior. It jumps to…
Artem Bobrov
  • 151
  • 2
  • 8
2
votes
1 answer

Cut/copy/paste keyboard shortcuts not working in NSPopover

I have a macOS NSPopover based tray app which shows a popover with login fields (username and password). Problem is that user is unable to copy-paste his email or password into text fields. The popover doesn't seem to allow keyboard shortcuts for…
mixtly87
  • 1,675
  • 15
  • 32
2
votes
1 answer

Set position of nspopover

I have a view controller (A), which will show another viewcontroller (B) as a popover. In my VC (A) is an NSButton with this IBAction: self.presentViewController(vcPopover, asPopoverRelativeTo: myButton.bounds, of: myButton, preferredEdge: .maxX,…
Trombone0904
  • 4,132
  • 8
  • 51
  • 104