217 questions
1
vote
0
answers
128
views
Is it possible to present a MenuBarExtra with popover window style?
How to append a popover's triangle to a window of MenuBarExtra element for SwiftUI macOS 15 app? MenuBarExtra's arsenal doesn't have the .popover(..) modifier, however, to apply it to ContentView() is ...
1
vote
1
answer
120
views
SwiftUI: Show popover at mouse click location
I am working with a SwiftUI List on macOS, and I have a popover view that I need to show from each row. I have an implementation that works but it shows the popover from one fixed point on the row. I ...
2
votes
0
answers
94
views
How to hide the disclosure indicator in macOS MenuBar app
I have a macOS SwiftUI menu bar app. I'm trying to figure out how to get rid of this disclosure triangle. The code for the popover is below.
private func setupStatusBarItem() {
statusBarItem = ...
0
votes
0
answers
50
views
Can't Programmatically Open Mac Menu Bar NSPopover View
I’m working on a Mac menu bar application and have this working code that opens/closes the window when toggling the menu bar app icon
@objc func togglePopover(_ sender: AnyObject?) {
if let button ...
1
vote
0
answers
116
views
How can I animate NSPopover size change?
I have a SwiftUI view with fields that changes according to an object type that is about to be created. Each type has a different amount of fields, what makes the popover size change. I would like to ...
0
votes
0
answers
51
views
Render bug with NSSlider within NSPopover in dark mode
Is it me or there is an bug with NSSlider when it is a subview of an NSPopover view?
Here's the code I use:
popover = NSPopover.new;
popover.contentViewController = NSViewController.new;
...
0
votes
0
answers
59
views
How to put searchable in NSPopover?
So I have the following ContentView shows as a popover in the menu bar.
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Create the SwiftUI view that provides the window ...
0
votes
1
answer
81
views
Force NSPopover resizing with animation
I have an NSPopover that I want to resize with animation. In my case, setContentSize works, but without animation (apple says that animation is not guaranteed).
I'm investigating the use of ...
0
votes
1
answer
797
views
SwiftUI: Stop Continuous Animations When Views Leave Screen
Context
NB: The question does NOT pertain to iOS
I have a Mac app that shows an NSPopover. The content of that popover is an NSHostingView that displays a simple SwiftUI view:
struct PopoverView: View
...
3
votes
0
answers
58
views
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 ...
0
votes
1
answer
104
views
macOS NSPopover menu bar app how to prioritize order app is displayed
I have a macOS menu bar app. I like to know can we prioritize the order that the app shows in the status bar.
//
// AppDelegate.swift
// elmc_midi_deck-macOS
//
// Created by Jerry Seigle on 6/23/...
2
votes
0
answers
156
views
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.
...
1
vote
1
answer
275
views
NSPopover not aligned to NSStatusItem menubar icon
I'm trying to make a menubar app for macOS 12 that shows a popover when the menubar icon is clicked. As you can see from the attached screenshot, I have the popover showing but it's not actually ...
5
votes
1
answer
1k
views
How to increase the icon button of Menu in MacOS App SwiftUI?
I want to increase the icon button of the Menu in SwiftUI for a macOS app, but modifiers such as .imageScale(.large), .resizable(), .scaleEffect(1.2), and changing font doesn't work.
image
Menu {
...
5
votes
1
answer
2k
views
Swift ui macOS menuBar NSPopover no arrow
How do I remove the arrow from the NSPopover?
Can you give me a hand?
AppDelegate:
import Cocoa
import SwiftUI
@main
class AppDelegate: NSObject, NSApplicationDelegate {
var popover = NSPopover....
2
votes
2
answers
1k
views
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:
...
8
votes
3
answers
2k
views
How to show NSPopover in SwiftUI lifecycle?
I'm trying to show a detachable NSPopover by clicking on a button but I'm stuck. I followed tuts how to show NSPopover but they all around Menubar apps.
My AppDelegate looks like this
final class ...
0
votes
1
answer
1k
views
SwiftUI macOS menubar icon with badge
As you can see from the image I have a program that should open as menubar, I would like to know if it was possible to add a badge as seen in image two to the menubar, to indicate that there are ...
0
votes
1
answer
997
views
Swift ui mac os menubar popover change background
As you can see from the image I have the menu bar popover which is transparent, I would like it to be a specific color instead.
How can I do, can you give me a hand?
StatusBarController
import AppKit
...
0
votes
0
answers
470
views
NSPopover positions incorrectly when NSWindow frame is programmatically changed
I have a button in an NSWindow that brings up an NSPopover with:
popover = NSPopover()
popover?.behavior = .applicationDefined
popover?.contentViewController = self
let myDelegate = MyDelegate()
...
2
votes
0
answers
144
views
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 ...
1
vote
0
answers
38
views
How can I colour the arrow part of a transparent NSPopover window? [duplicate]
I would like the popup to be transparent except for the arrow and the bottom-most part of it (bottom part is no problem, of course). I have a NSTableView in the middle so far.
So in NSPopover I added ...
0
votes
1
answer
244
views
How can I dismiss a nspopover from within a view?
I am writing a MacOS using Swift & SwiftUI. I am really very new to this, but I am a seasoned programmer.
The app is a menu bar app with one NSPopover. In the AppDelegate I include:
self.popover = ...
3
votes
1
answer
251
views
Prevent NSPopover from clipping offscreen
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 ...
1
vote
0
answers
511
views
macOS SwiftUI popover with TextField closes on first edit
I'm building a macOS SwiftUI app. In it, I have a popover with a TextField. The TextField has a binding that updates an ObservableObject that then propagates its value back down a NavigationView to ...
0
votes
1
answer
145
views
Is it even possible to make NSPopver fully transparent?
I tried my hands on changing the color of NSPopover, I am able to change to it all desired color except transparent.
As, it is known that NSPopover is by default semi transparent. I tried changing the ...
1
vote
0
answers
226
views
What value should I pass in NSPopover's showRelativeToRect:ofView:preferredEdge: method's ofView: parameter?
I am looking online for an answer since yesterday, but NSPopover doesn't seem to get a lot of attention.
The thing is I haven't understood the ofView: parameter exactly. When I look at some code ...
2
votes
1
answer
162
views
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, '...
0
votes
1
answer
290
views
How can I pin an NSPopover to a selected NSTableCellView in swift5
I have the code shown below, that pins an NSPopover to my NSTableView. I've looked all over Google, and SO, but I cannot find a way to pin the popover to a specific (selected) cell.
@objc func ...
3
votes
1
answer
7k
views
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?
...
0
votes
1
answer
503
views
How to give an NSPopover focus when NSStatusItem is clicked?
I am building a macOS menubar app in Swift, using an NSStatusItem, which opens an NSPopover when the NSStatusItem's button is clicked.
How can I also give the NSPopover focus? Currently, the user ...
0
votes
0
answers
169
views
Trying to understand a SIGSEGV crash when showing an NSPopover
I am getting a crash with the following stack trace and I am not sure to understand what is happening and how to fix it:
libobjc.A.dylib
objc_release
libobjc.A.dylib
(anonymous namespace)::...
0
votes
1
answer
200
views
NSPopover dismissal does not remove it from parent's presentedViewControllers (Xcode 11)
Using Xcode 11 & macOS 10.15, I have a ParentViewController that presents a PopoverViewController in .transient mode (= clicking outside the popover dismisses it).
When the user clicks outside ...
2
votes
0
answers
82
views
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....
0
votes
1
answer
312
views
NSPopover + NSBox in dark mode tint/gamma issue
I have NSPopover with NSBox and subviews are: MKMapView and NSImageView. In dark mode the whole NSBox adds gamma/tint to all subviews. This doesn't appear in light mode (compare images below). It ...
1
vote
0
answers
226
views
Moving NSPopover as NSRulerView scrolls
Background
The default implementation of NSPopover will move the popover when the view it's shown over scrolls (and has special handling for when the NSRect it's attached to scrolls out of view). An ...
0
votes
1
answer
504
views
NSPopover doesn't receive first click after opening
I have an NSPopover which I have set the contentViewController of and am using to display some custom UI. The popover is set to toggle open when the user clicks the status item in the status bar at ...
8
votes
3
answers
2k
views
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 ...
3
votes
1
answer
875
views
Emoji List in NSPopover on macOS like Messages App
I want to show an NSPopover in my Mac app that lists the emoji just like Apple's Messages app does like this:
All I can figure out so far is that I can show the character palette in my app using this:...
0
votes
1
answer
303
views
NSScrollView in a popup became transparent under MacOS Mojave
In a view displayed as a Popover, I implement a help subview (a NSView with a NSScrollView as a subview) that appears when user click on a button. With Sierra & High Sierra, everything was all ...
6
votes
0
answers
650
views
How can I make NSPopover detach programmatically?
I have a NSPopover that is draggable but I want to make it detach by clicking on a button. Like Bear Notes App.
2
votes
1
answer
1k
views
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 ...
2
votes
0
answers
300
views
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 ...
3
votes
2
answers
2k
views
How can I make my app behave like I'm changing Application is agent(UIElement) at runtime using Swift?
I am coding a Mac app that is an NSPopover on the right side of the menu bar (Application is agent(UIElement) is set to YES). I allow the user to detach the popover by clicking and dragging it ...
10
votes
2
answers
2k
views
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(...
2
votes
1
answer
956
views
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 ...
0
votes
1
answer
232
views
NSSegmentedControl - Odd appearance when placed in blur view
I have a macOS app with a simple popover view and a NSSegmentedControl placed within it. Everything works fine, apart from the odd appearance of the segmented control. It has this weird square ...
1
vote
1
answer
333
views
How to automatically close an NSPopover in NSStatusBar on Exposé/Mission Control
For other applications, like Dropbox and 1Password, the popover that opens when you click the NSStatusItem in the top bar automatically hides (and then reshows) if you open up Exposé/Mission Control ...
10
votes
2
answers
2k
views
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 ...
0
votes
1
answer
580
views
Resize NSPopover does not update
I have an NSPopover where I change the content view of but when I set the view controller to something bigger than before, it shows the size that it was and I need to close and open it.
static func ...