popup opens not in every case #623
-
Trying to open a popup, but it only works in one of three code paths. What am I doing wrong ? // PopupName is a global constant string variable
giu.SingleWindowWithMenuBar().Layout(
giu.PopupModal(PopupName).Layout(
giu.Label("Hello"),
giu.Button("Ok").OnClick(func() { giu.CloseCurrentPopup() }),
),
giu.MenuBar().Layout(
giu.Menu("Help").Layout(
giu.MenuItem("test a").OnClick(func() {
// DOESN'T WORK
giu.OpenPopup(PopupName)
}),
),
),
giu.Selectable("test b").OnClick(func() {
// DOES WORK
giu.OpenPopup(PopupName)
}),
giu.Label("foo"),
giu.ContextMenu().Layout(
giu.Selectable("test c").OnClick(func() {
// DOESN'T WORK
giu.OpenPopup(PopupName)
}),
....
), |
Beta Was this translation helpful? Give feedback.
Answered by
AllenDang
Dec 2, 2022
Replies: 1 comment 3 replies
-
Popup can only be opened by the widget which be defined at the same level. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
manuel-koch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Popup can only be opened by the widget which be defined at the same level.
In your code, menuitem is inside menu, and selectable is inside context menu.
To ignore this mechanism, you could use a boolean to open the popup instead.