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

[v3] Cannot hide a newly-created MenuItem #4077

Closed
IanVS opened this issue Feb 14, 2025 · 3 comments
Closed

[v3] Cannot hide a newly-created MenuItem #4077

IanVS opened this issue Feb 14, 2025 · 3 comments
Labels
Bug Something isn't working

Comments

@IanVS
Copy link

IanVS commented Feb 14, 2025

Description

If you create a menu item, then immediately hide it, it will not be hidden. Hiding in an event handler or click handler does however work.

To Reproduce

 myMenu := app.NewMenu()
 myMenu.Add("Hidden").SetHidden(true)
 systemTray.SetMenu(myMenu)

Image

Expected behaviour

The menu item should be hidden

Screenshots

No response

Attempted Fixes

No response

System Details

Wails (v3.0.0-dev)  Wails Doctor

# System

┌──────────────────────────────────────────────────┐
| Name          | MacOS                            |
| Version       | 15.2                             |
| ID            | 24C101                           |
| Branding      | MacOS 15.2                       |
| Platform      | darwin                           |
| Architecture  | arm64                            |
| Apple Silicon | true                             |
| CPU           | Apple M2 Max                     |
| CPU 1         | Apple M2 Max                     |
| CPU 2         | Apple M2 Max                     |
| GPU           | 30 cores, Metal Support: Metal 3 |
| Memory        | 64 GB                            |
└──────────────────────────────────────────────────┘

# Build Environment

┌─────────────────────────────────────────────────────────┐
| Wails CLI    | v3.0.0-dev                               |
| Go Version   | go1.23.5                                 |
| Revision     | 2c85b109aca5c9afe9a42fb0f26a3b9cfa235ec7 |
| Modified     | false                                    |
| -buildmode   | exe                                      |
| -compiler    | gc                                       |
| CGO_CFLAGS   |                                          |
| CGO_CPPFLAGS |                                          |
| CGO_CXXFLAGS |                                          |
| CGO_ENABLED  | 1                                        |
| CGO_LDFLAGS  |                                          |
| GOARCH       | arm64                                    |
| GOARM64      | v8.0                                     |
| GOOS         | darwin                                   |
| vcs          | git                                      |
| vcs.modified | false                                    |
| vcs.revision | 2c85b109aca5c9afe9a42fb0f26a3b9cfa235ec7 |
| vcs.time     | 2025-02-09T05:57:06Z                     |
└─────────────────────────────────────────────────────────┘

# Dependencies

┌───────────────────────────┐
| npm             | 10.9.2  |
| *NSIS           | v3.10   |
| Xcode cli tools | 2409    |
└─ * - Optional Dependency ─┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Additional context

https://discord.com/channels/1042734330029547630/1334926670070677555/1334926670070677555

@IanVS IanVS added the Bug Something isn't working label Feb 14, 2025
@leaanthony
Copy link
Member

Apologies for the delay on this. It took me longer to fight gpg and commit signing than to do the fix >.< Fixed in 244f322 - updated example to demonstrate.

@leaanthony
Copy link
Member

Closing as completed. Feel free to reopen if it's still not working 👍

@IanVS
Copy link
Author

IanVS commented Feb 18, 2025

Thanks, it does indeed start out hidden now, but I can't unhide it. 😆

I'll open a separate issue about that, I guess, since I don't have permissions to reopen this one (and it's a different issue now anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants