From 58936354f9adc194293e1b899bcd428ccb7a537b Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 25 Sep 2024 11:09:26 -0400 Subject: Add Python exampels for UIContextNotification::OnContextMenuCreated --- python/examples/ui_notifications.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/examples/ui_notifications.py') diff --git a/python/examples/ui_notifications.py b/python/examples/ui_notifications.py index c6809a32..a6739886 100644 --- a/python/examples/ui_notifications.py +++ b/python/examples/ui_notifications.py @@ -94,6 +94,10 @@ class UINotification(UIContextNotification): print(f"py GetNameForPath {path} {name}") return False + def OnContextMenuCreated(self, context, view, menu): + # This function only works in C++: Name is an out param (cpp: &name), and not modifiable by python. + print(f"py OnContextMenuCreated {context} {view} {menu}") + # Register as a global so it doesn't get destructed notif = UINotification() -- cgit v1.3.1