-
Beta Was this translation helpful? Give feedback.
Answered by
Aylur
Feb 24, 2024
Replies: 1 comment 2 replies
-
you can either keep a reference to the menu and reuse it, or destroy it explicitly after it closes // keep a reference
function EventBox() {
const menu = Widget.Menu()
return Widget.EventBox({
on_secondary_click: (_, event) => {
menu.popup_at_pointer(event)
},
})
}
// destroy explicitly
on_secondary_click: (_, event) => {
return Widget.Menu()
.on("notify::visible", (self) => {
if (!self.visible)
self.destroy()
})
.popup_at_pointer(event)
}, |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
A7R7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can either keep a reference to the menu and reuse it, or destroy it explicitly after it closes