menubar

Cocoa application menu bar not clickable

有些话、适合烂在心里 提交于 2019-12-03 16:26:31
I'm building a menu bar in my cocoa application with the following code in the @implementation of my custom application CustomApplication : +(void) setUpMenuBar { [CustomApplication sharedApplication]; // Main menu NSMenu* mainMenu = [NSApp mainMenu]; if (mainMenu != nil) return; // We set it already mainMenu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; [NSApp setMainMenu:mainMenu]; // Application menu NSMenuItem* appleItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; NSString* appName = @"MyApp"; NSMenu* appleMenu = [[NSMenu alloc] initWithTitle:@""]; // Apple menu

macOS menubar application: main menu not being displayed

与世无争的帅哥 提交于 2019-12-03 09:41:08
问题 I have a statusbar application, which runs in the menu bar. Therefore I set Application is agent (UIElement) to true in the info.plst . That results in no dock icon and no menu bar for my application. However, I also have a preference window that the user can open from the statusbar menu. Here is how I open it: if (!NSApp.setActivationPolicy(.regular)) { print("unable to set regular activation policy") } NSApp.activate(ignoringOtherApps: true) if let window = preferencesWindowController

Cross-platform Python GUI suitable for taskbar (Win) and menubar (mac) functionality?

筅森魡賤 提交于 2019-12-03 07:52:01
I am fairly new to Python programming, and completely new to cross-platform GUI building (only previous GUI experience is through visual basic and Java). I've written some python code to screen-scrape data from a website, and now I want to build a GUI that will reside in the Mac OS X menubar, and in Window's task bar (i.e., the system tray) . The most useful general page on cross-plaform Python GUIs for me was this one (despite its name indication Window GUIs). And some stackoverflow questions came in useful as well (especially this one , and the accepted answer of this one about splitting up

How can I detemine which screen holds the menubar?

一世执手 提交于 2019-12-02 12:57:41
问题 In Cocoa, how can I determine which screen holds the menubar when the computer has multiple screens? Here's what I have so far: NSArray * screens = [NSScreen screens]; NSScreen * mainScreen = [screens objectAtIndex:0]; if ([screens count] > 1) { for (NSScreen * screen in screens) { if (/* screen == the screen that holds the menubar */) { mainScreen = screen; break; } } } NSLog(@"the main screen is: %@", mainScreen); Note: I tried using [NSScreen mainScreen] , but that simply returns the

JavaFX - How to create a thin MenuBar?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 09:25:12
问题 I've placed at the top of a BorderPane a MenuBar with a "File" Menu and a "Close" MenuItem inside: How can I make it look thinner like the MenuBar s of most of the software I use, similar to the image below? I think it must be simple enough but as a beginner I couldn't really google it. I'm not sure how to name the problem (not many useful results for "javafx menubar height", size, styling, etc.) 回答1: Adding the following selectors to you stylesheet reduces the height of each menu element:

JavaFX - How to create a thin MenuBar?

北城以北 提交于 2019-12-02 04:54:51
I've placed at the top of a BorderPane a MenuBar with a "File" Menu and a "Close" MenuItem inside: How can I make it look thinner like the MenuBar s of most of the software I use, similar to the image below? I think it must be simple enough but as a beginner I couldn't really google it. I'm not sure how to name the problem (not many useful results for "javafx menubar height", size, styling, etc.) Adding the following selectors to you stylesheet reduces the height of each menu element: .menu-item { -fx-padding: 1 5 1 5; } .menu { -fx-padding: 1 5 1 5; } To remove the padding of all context

Adding a Menu to the Visual Studio Menu Bar within an Add-In

南楼画角 提交于 2019-12-02 03:51:20
问题 Is it possible to create an add a custom menu to the main menu bar in Visual Studio within an Add-In? I want the Add-In to create a company specific menu if it does not already exist and then add its own specific command to that menu. That way if multiple Add-Ins are supplied then they can all add the commands to the same menu. I have found an msdn link for a walkthrough in creating a VSPackage which does this but not from within an Add-In and it requires its own specific installation

How can I detemine which screen holds the menubar?

拈花ヽ惹草 提交于 2019-12-02 03:13:34
In Cocoa, how can I determine which screen holds the menubar when the computer has multiple screens? Here's what I have so far: NSArray * screens = [NSScreen screens]; NSScreen * mainScreen = [screens objectAtIndex:0]; if ([screens count] > 1) { for (NSScreen * screen in screens) { if (/* screen == the screen that holds the menubar */) { mainScreen = screen; break; } } } NSLog(@"the main screen is: %@", mainScreen); Note: I tried using [NSScreen mainScreen] , but that simply returns the screen on which the currently active window resides. It only returns the screen that has the menubar if

Adding a Menu to the Visual Studio Menu Bar within an Add-In

血红的双手。 提交于 2019-12-02 01:04:27
Is it possible to create an add a custom menu to the main menu bar in Visual Studio within an Add-In? I want the Add-In to create a company specific menu if it does not already exist and then add its own specific command to that menu. That way if multiple Add-Ins are supplied then they can all add the commands to the same menu. I have found an msdn link for a walkthrough in creating a VSPackage which does this but not from within an Add-In and it requires its own specific installation/registration. public static CommandBarControl GetCustomMenu(DTE2 applicationObject) { //Find the MenuBar

MenuBar widget in Vaadin Flow (Vaadin 10) missing?

自作多情 提交于 2019-12-01 22:17:42
Vaadin Framework (Vaadin 8) offers a MenuBar widget, as discussed in the manual , and shown in the Sampler . When I switch the manual to "Vaadin 10" mode, I cannot find the MenuBar widget. I know Vaadin 10 (Vaadin Flow) is a major re-write of Vaadin, is the widget changed in name or not yet available? Possibly in Vaadin 14 Update: A MenuBar widget is planned for development by Vaadin Ltd, scheduled for Vaadin 14 release. See the manual . On GitHub, see Issue # 4694 MenuBar component . No MenuBar in Vaadin 10 or 11 As discussed in this Forum thread , as of version 11.0.1, Vaadin Flow currently