You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to open a PopupMenuButton when clicking or long-pressing a different element (e.g., a message bubble). Currently, the menu only appears when clicking the PopupMenuButton itself.
Is there a way to programmatically open the popup menu from another control's event (like on_click or on_long_press)?
`
import flet as ft
import flet.canvas as cv
import math
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to open a PopupMenuButton when clicking or long-pressing a different element (e.g., a message bubble). Currently, the menu only appears when clicking the PopupMenuButton itself.
Is there a way to programmatically open the popup menu from another control's event (like on_click or on_long_press)?
`
import flet as ft
import flet.canvas as cv
import math
class PiApp(ft.Control):
def init(self, page: ft.Page):
super().init()
self.page = page
self.containers_init()
def main(page: ft.Page):
page.padding = 0
page.spacing = 0
app = PiApp(page)
page.add(app.dm_screen)
page.update()
ft.app(target=main, assets_dir='assets')
`
here look
def show_msg_menu(self, e: ft.LongPressEndEvent):
print(e.target)
Beta Was this translation helpful? Give feedback.
All reactions