Menu Bar #136

Closed
opened 2026-01-29 16:32:11 +00:00 by claunia · 3 comments
Owner

Originally created by @ramin0011 on GitHub (Apr 1, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

When i start the app it loads defined menus in my code but after a moment ( usually a few seconds ) it will change to the defualt electron.net menu
image

i tryed to set the menu everywhere in the code (in events: OnReadyToShow, OnShow , also before and after the events ) but it didnt help me

Electron.Menu.SetApplicationMenu(menuItems); window.OnReadyToShow += () => { window.Show(); window.SetTitle("myapp"); Electron.Menu.SetApplicationMenu(menuItems); }; window.SetTitle("myapp"); window.OnShow += () => { window.SetTitle("myapp"); Electron.Menu.SetApplicationMenu(menuItems); }; Electron.Menu.SetApplicationMenu(menuItems);

Originally created by @ramin0011 on GitHub (Apr 1, 2018). Originally assigned to: @GregorBiswanger on GitHub. When i start the app it loads defined menus in my code but after a moment ( usually a few seconds ) it will change to the defualt electron.net menu ![image](https://user-images.githubusercontent.com/4890955/38172545-e2d43550-3562-11e8-8548-e9a17ec7323c.png) i tryed to set the menu everywhere in the code (in events: OnReadyToShow, OnShow , also before and after the events ) but it didnt help me ` Electron.Menu.SetApplicationMenu(menuItems); window.OnReadyToShow += () => { window.Show(); window.SetTitle("myapp"); Electron.Menu.SetApplicationMenu(menuItems); }; window.SetTitle("myapp"); window.OnShow += () => { window.SetTitle("myapp"); Electron.Menu.SetApplicationMenu(menuItems); }; Electron.Menu.SetApplicationMenu(menuItems);`
Author
Owner

@GregorBiswanger commented on GitHub (Apr 14, 2018):

Hi @ramin0011
set your own menu outside of the events please.
The best way is after you create a window.

I think you get a exception from your defined menu call logic and electron switch to his own menu.
See in the console from the developer tools (Ctrl+I)

I hope my answer helps you.

@GregorBiswanger commented on GitHub (Apr 14, 2018): Hi @ramin0011 set your own menu outside of the events please. The best way is after you create a window. I think you get a exception from your defined menu call logic and electron switch to his own menu. See in the console from the developer tools (Ctrl+I) I hope my answer helps you.
Author
Owner

@ramin0011 commented on GitHub (Apr 22, 2018):

i do not get any exception from developer console ...

@ramin0011 commented on GitHub (Apr 22, 2018): i do not get any exception from developer console ...
Author
Owner

@srameh commented on GitHub (Jul 31, 2018):

@ramin0011 please try the solution in this page. It worked like a charm for me.
https://elanderson.net/2018/05/electron-net-custom-application-menus/

@srameh commented on GitHub (Jul 31, 2018): @ramin0011 please try the solution in this page. It worked like a charm for me. https://elanderson.net/2018/05/electron-net-custom-application-menus/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#136