Skip to content

Noob Question on Menus etc #427

Closed
Closed

Description

@andymans

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.

Activity

  1. added
    S - enhancement
    on Mar 23, 2018
  2. Osspial commented on Apr 3, 2018

    @Osspial
    Contributor

    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.

  3. added
    H - help wanted
    S - api
    C - needs discussion
    D - hard
    P - low
    on May 6, 2018
  4. Osspial commented on Apr 24, 2019

    @Osspial
    Contributor

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

  5. timtom-rs commented on Feb 9, 2021

    @timtom-rs

    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?

  6. maroider commented on Feb 9, 2021

    @maroider
    Member

    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.

  7. added a commit that references this issue on Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C - needs discussionD - hardH - help wantedP - lowS - apiS - enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions