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

[feat] Radio menu item and default menu item #260

Open
tauri-bot opened this issue Jan 9, 2025 · 0 comments
Open

[feat] Radio menu item and default menu item #260

tauri-bot opened this issue Jan 9, 2025 · 0 comments

Comments

@tauri-bot
Copy link

This issue has been upstreamed from tauri-apps/tauri#12322

Describe the problem

I am writing a tray application under Windows. The tray menu needs to have multiple radio items and set a default item. I read the menu-related documents and did not find a way to implement this function.
It is easy to implement in traditional Window applications, and the effect is as follows:
image

Describe the solution you'd like

Radio item: Checks a specified menu item and makes it a radio item. At the same time, the function clears all other menu items in the associated group and clears the radio-item type flag for those items.

Default item: Specifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold.

Win32 API
CheckMenuRadioItem(): https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-checkmenuradioitem
SetMenuDefaultItem(): https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setmenudefaultitem
MENUITEMINFOA structure MFT_RADIOCHECK and MFS_DEFAULT: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-menuiteminfoa

Alternatives considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant