How to get a menu bar using a SingleWindowWithMenuBar? #617
-
I'm trying to add a menubar to my window, by adapting the example. But it doesn't work, what is my error ? E.g. within my giu.MainMenuBar().Layout(
giu.Menu("Help").Layout(
giu.MenuItem("About").OnClick(func() { fmt.Println("ABOUT") }),
),
).Build()
giu.Window("Window 1").Pos(10, 30).Size(200, 100).Layout(
giu.Label("I'm a label in window 1"),
giu.Button("Show Window 2").OnClick(func() { fmt.Println("CLICKED") }),
) BUT e.g. adapting the example to use a giu.MainMenuBar().Layout(
giu.Menu("Help").Layout(
giu.MenuItem("About").OnClick(func() { fmt.Println("ABOUT") }),
),
).Build()
giu.SingleWindowWithMenuBar().Layout(
....
) and equally empty main menu area with the giu.SingleWindowWithMenuBar().Layout(
giu.MainMenuBar().Layout(
giu.Menu("Help").Layout(
giu.MenuItem("About").OnClick(func() { fmt.Println("ABOUT") }),
),
),
) slightly changing the code results in a broken main menu, i.e. there is still this empty area but the menu item appears somewhere below ( but not within the empty area ): giu.SingleWindowWithMenuBar().Layout(
giu.Menu("Help").Layout(
giu.MenuItem("About").OnClick(func() { fmt.Println("ABOUT") }),
),
) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I remember i did it working on my https://github.com/thegreaterheptavirate/constitutor |
Beta Was this translation helpful? Give feedback.
I remember i did it working on my https://github.com/thegreaterheptavirate/constitutor
It is in pkg/app
I can post you a exact code a bit later