File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ def execute_on_main_thread(func):
6565 on the main Binary Ninja thread.
6666
6767 .. warning:: May be required for some GUI operations, but should be used sparingly as it can block the UI.
68+
69+ :Example:
70+ >>> # Execute a GUI operation on the main thread
71+ >>> import binaryninjaui
72+ >>> from binaryninja import execute_on_main_thread
73+ >>> execute_on_main_thread(lambda: binaryninjaui.UIContext.activeContext().openFileContext(context))
6874 """
6975 action = scriptingprovider ._ThreadActionContext (func )
7076 obj = core .BNExecuteOnMainThread (0 , action .callback )
@@ -79,6 +85,12 @@ def execute_on_main_thread_and_wait(func):
7985 executed on the main Binary Ninja thread and will block execution of further python until the function returns.
8086
8187 .. warning:: May be required for some GUI operations, but should be used sparingly as it can block the UI.
88+
89+ :Example:
90+ >>> # Execute a GUI operation and wait for it to complete
91+ >>> import binaryninjaui
92+ >>> from binaryninja import execute_on_main_thread_and_wait
93+ >>> execute_on_main_thread_and_wait(lambda: binaryninjaui.UIContext.activeContext().rebaseCurrentView(0x800000))
8294 """
8395 action = scriptingprovider ._ThreadActionContext (func )
8496 core .BNExecuteOnMainThreadAndWait (0 , action .callback )
You can’t perform that action at this time.
0 commit comments