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 can I make it look to see that the popover is open and when it is open to close the popover when I press the same button?
How to make action to close NSPopover?
6.3k Views Asked by sridvijay At
1
There are 1 best solutions below
Related Questions in COCOA
- How do I customize NSOutlineView to have border color?
- How to generate request format for WCF web service method for Mac and iPhone
- How to Handle Command Line Prompt from a Cocoa App
- Change views inside NSSplitViewController
- CMYK NSImage get pixel data
- Reactive Cocoa Conditional Split ?
- Set background color of NSImageView with proportionally sized image
- Use NSWindow or NSViewController?
- Imports and includes in header files - when is it okay?
- How to prevent the app from automatically open a window when launched?
- Swift NSViewController responds to mouseDown event, but not keyDown event
- "stringByAddingPercentEncodingWithAllowedCharacters" replaces more characters than it should
- cocoa - what happen when close a window (by pressing the red X button)?
- Does it necessary to go back to main thread to update UI?
- WebView not responding to Keyboard input
Related Questions in POPOVER
- UIDocumentInteractionController presentation style
- Test with mouseover & mouseleave only works with 1000ms timeout
- Creating a Scrollable Popover Without Scrollbar
- UIPickerView not showing in popover
- xcode navigationbar is not more visible after popover with button
- How to get a variable value from popover made in storyboard? (in Swift)
- Prevent bootstrap popover from disappearing after postback
- Trying to hide/show text field on ViewCont A, from popover(ViewCont B) with table view
- Bootstrap Popover Inside Popover not working
- Trouble with creating a popover withs storyboard in Xcode
- How to dismiss a popover only with a button in swift
- Popover or Tooltip doesn't work at all in my browser
- Show popOver when right click on TableViewCell
- Bootstrap Popover won't change value in while loop
- .arrow class styling in bootstrap priority
Related Questions in APPKIT
- Using autolayout, how can I center a subview in an NSSplitView without forcing the width NSSplitView to be static?
- Prevent NSScrollView from flashing its scroller
- How to show NSTextView-like context menu
- NSSearchField occasionally causing an NSInternalInconsistencyException
- NSTextField draws white area after resigning first responder
- macOS AppKit: Strange dragging behavior of modeless NSSavePanel
- Sample NSImage and retain quality (swift 3)
- MacOS views rendering same font differently
- Hide the mouse in a Mac application after not moving it
- ViewController + Storyboard setting up validation with controlTextDidChange
- Why does NSLocale.current.identifier include currency on macOS?
- C Disable command-line input
- OSX Layout positioning from code cause wrong position
- NSScrollView how to start from top left corner
- Custom selection style for view based "Source List" NSOutlineView
Related Questions in NSPOPOVER
- Why radio not selected in ns-popover popup. Radio is only seleced in table last column popup
- Make menu bar view not hide when clicking outside view
- Closing an NSPopover when clicking a button in its contentViewController
- Set position of nspopover
- Making a Mac Popover appear inside the app's area
- Mac: Display hierarchical lists of data plus detail view (similar to UINavigationController + UITableViewController)
- After detaching an NSPopover the next appearance is missing callout
- NSPopover in HUD mode blurs - but NSWindow in HUD does not
- Load WebView URL inside Notification Bar NSPopover
- NSPopover custom animation
- How to deal with first responder and a NSPopover
- NSTextField inside NSPopover is not key until mouse click
- How do i get NSPopover to be first responder from the NSStatusbar?
- NSPopover color
- How to create NSPopover programmatically
Related Questions in UIBUILDER
- How do you launch a second MainWindow.xib in an iPad application?
- iPad view lifecycle: What does the "window" do? Can you have more than one window for an App?
- Unable to open Uibuilder (Node-red) on Rasberry pi
- how to change multiple UI elements on runtime
- Marmalade UIBuilder missing?
- Adding a row in Spec results in a column?
- Node Red has a UiBuilder, but I want to listen to it from another app, using socket.io-client, fails to est connection
- Update UI element in custom Swift class
- How to manage multiple UIViewController from one Container?
- Growl type notification on iPad/iPhone?
- How to make action to close NSPopover?
- Show progress line over existing elements
- ipad - HelloWorld How To View a PDF
- NativeScript UI-Builder
- Google maps v 3 & GWT wrapper
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I solved the problem!
That should make the popover disappear once someone has clicked outside the popover.
Another way to close the popover is to have a separate button. Just add another
NSButtonand then link it to the popover on the sidebar and set it to Received actions -> perform close: