Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noob Question on Menus etc #427

Closed
andymans opened this issue Mar 21, 2018 · 4 comments
Closed

Noob Question on Menus etc #427

andymans opened this issue Mar 21, 2018 · 4 comments
Labels
C - needs discussion Direction must be ironed out D - hard Likely harder than most tasks here H - help wanted Someone please save us P - low Nice to have S - api Design and usability S - enhancement Wouldn't this be the coolest?

Comments

@andymans
Copy link

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?

Thx.

@tomaka tomaka added the S - enhancement Wouldn't this be the coolest? label Mar 23, 2018
@Osspial
Copy link
Contributor

Osspial commented Apr 3, 2018

Winit currently doesn't have an explicit API for handling window menus. On Windows, you can use the CreateMenu and SetMenu APIs on HWNDs, and on Mac you can use application menus. You can get the data you need to handle those with the platform-specific os modules.

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.

@francesca64 francesca64 added H - help wanted Someone please save us S - api Design and usability C - needs discussion Direction must be ironed out D - hard Likely harder than most tasks here P - low Nice to have labels May 6, 2018
@Osspial
Copy link
Contributor

Osspial commented Apr 24, 2019

Closing this, since we've decided that this is out of scope for Winit.

@Osspial Osspial closed this as completed Apr 24, 2019
@timtom-dev
Copy link

Winit currently doesn't have an explicit API for handling window menus. On Windows, you can use the CreateMenu and SetMenu APIs on HWNDs, and on Mac you can use application menus. You can get the data you need to handle those with the platform-specific os modules.

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?

@maroider
Copy link
Member

maroider commented Feb 9, 2021

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.

tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
Document the rest of `pathfinder_content`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out D - hard Likely harder than most tasks here H - help wanted Someone please save us P - low Nice to have S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

6 participants