You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First - winit looks excellent. I'd like to use it to deliver a desktop app; but I need to be able to:
a) add native Menu support to the application
b) have those menus localized based on the User's OS language settings
Is this something I can do in winit, or do I need to extend it in some way?
I have no idea how you'd handle menus on Linux, as I think that's handled by non-native widget APIs like GTK+ or Qt. There may be some way to set window menus that doesn't rely on a specific API, but I'm not all that familiar with Linux desktop development.
Hey @Osspial Sorry if I'm misunderstanding something, I'm not yet familiar with the Cocoa API. I'm also trying to create a menu, and it looks like I need a reference to an NSApplication object, but I don't see a winit function that exposes one from the macOS module. Do you have an example I could look at?
If it's not exposed in the platform::macos module, then it's not exposed anywhere at all.
I've gone ahead and opened #1855 so that manipulating the menu bar may actually become possible.
Activity
Osspial commentedon Apr 3, 2018
Winit currently doesn't have an explicit API for handling window menus. On Windows, you can use the
CreateMenuandSetMenuAPIs onHWNDs, and on Mac you can use application menus. You can get the data you need to handle those with the platform-specificosmodules.I have no idea how you'd handle menus on Linux, as I think that's handled by non-native widget APIs like GTK+ or Qt. There may be some way to set window menus that doesn't rely on a specific API, but I'm not all that familiar with Linux desktop development.
Osspial commentedon Apr 24, 2019
Closing this, since we've decided that this is out of scope for Winit.
timtom-rs commentedon Feb 9, 2021
Hey @Osspial Sorry if I'm misunderstanding something, I'm not yet familiar with the Cocoa API. I'm also trying to create a menu, and it looks like I need a reference to an
NSApplicationobject, but I don't see a winit function that exposes one from the macOS module. Do you have an example I could look at?maroider commentedon Feb 9, 2021
If it's not exposed in the
platform::macosmodule, then it's not exposed anywhere at all.I've gone ahead and opened #1855 so that manipulating the menu bar may actually become possible.
Auto merge of rust-windowing#427 - pcwalton:content-docs, r=pcwalton