is there a way to programaticly open/show the applicationDockMenu - swift

is there a way to programaticly open/show the applicationDockMenu
this is the menu you get when you right click on an open app in the dock

Related

How can I show VS Code's disappeared extensions and files sidebar?

When I was working I don't know where I clicked, but then the Extensions and Files sidebar disappeared.
Go to View -> Appeareance and then reenable the Activity Bar by setting a checkmark there.
View > Appearance > Show Activity Bar.
Another way is by clicking on Customize Layout right next to the Minimize Button, and then click on Activity Bar to make it visible

How assistant model works in swift?

I build a new class called StaticCellTableViewController. Now I want to connect some element from the Main.storyboard to it. But I can't have these two windows side by side.
I go the StaticCellTableViewController and click assistant. It gives me two StaticCellTableViewController windows.
I try to click assistant in the Main.storyboard window. It gives me another class like this.
But I want the Main.storyboard window and the StaticCellTableViewController class side by side so I can drag elements to it. How can I do that?
You do not need Assistant any more. Don’t use it. Editor panes can now contain anything.
So open two normal editor panes. Click in one pane. Click your view controller in the navigator. Click in the other pane. Click your storyboard in the navigator. Done.

how to keep the dockMenu open when clicking items in cocoa app

i have items in my dock menu that needs the dock menu to stay open
when the items are clicked
im refering to when u right click on an app and you get the dock menu
automaticly, it closes it
anyway to override this?

Cocoa Swift: Connect Main Menu to Preferences Window Controller & Disabling Items like Minimise in Attributes Inspector doesn't work in Xcode?

I have a simple Menubar app in which it has 2 options - namely Preferences & Quit
After clicking on Preferences it opens a new window but doesn't show the menu bar
I tried connecting from Main Menu to the Window Controller but it doesn't work.
I drag it from the Application Name to the Window Controller or View Controller using Ctrl+Drag but still it doesn't work.
Another issue is my Preferences Window is resizing even though I unchecked the resize button in the Attributes Inspector.
Even Maximise & Minimise checkboxes are disabled but they are still showing.
Any solutions?
See NSApplication.activationPolicy.
If you want the app's main menu bar to appear, you'll need to change the activationPolicy to NSApplicationActivationPolicyRegular. Once you do that, the app's main menu will appear when your app is the active one. (It will also appear in the dock.)
If you want this to happen only when your preferences window is open, then you'll need to change the activationPolicy when the window opens, then set it back again when it closes.
You don't need to connect any outlets for this; the Main Menu should already be a resource for your app and should be loaded automatically when your app launches.
I think I had given Storyboard Id to my View Controller rather than my Window Controller so it wasn't working.
I also checked some apps like Dropbox which didn't have Main Menu Bar because it was a background or accessory app so I ditched it.
Some apps like Focus have it though. But I went with the popular choice.
As for no resizing, no minimising & no maximising goes, I pasted below code & it worked
var myWindow: NSWindow? = nil
myWindow?.styleMask.remove(NSWindow.StyleMask.resizable)
myWindow?.standardWindowButton(.miniaturizeButton)?.isEnabled=false
myWindow?.standardWindowButton(.zoomButton)?.isEnabled=false

Is there way to handle system tray icon window over dropdown window

How to access/use the window which is underneath another window upon it, please click on the link to check this case
I'm using pywinauto to do this, is there a way to handle this case/issue.
Issue:
By following this link, able to open system tray and click on the icon, which results in drop-down menu.
But when i try to mover over mouse to click specific option from drop-down, hidden icons window re-appears on top of the drop-down list, which results in wrong click.
Is there a way to handle these windows?