Skip to content

Conversation

@linev
Copy link
Member

@linev linev commented Nov 27, 2025

Following approach from #17587

Implement alternative TBrowser::Draw() which runs event loop when block option is on.
So one can use TBrowser (web and classic) from any python session just doing:

br = ROOT.TBrowser()
br.Draw(block=True)

Or one can directly provide block parameter to the constructor:

br = ROOT.TBrowser(block=True)

Move run_root_event_loop function to __init__.py script - while it used from canvas and from browser

Same as with TCanvas::Draw(),
provide block flag to let run event loop until user press space key
Let use it for pythonization of TCanvas and TBrowser
Copy link
Member

@bellenot bellenot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you on this one 😉

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Test Results

    22 files      22 suites   3d 17h 20m 32s ⏱️
 3 780 tests  3 779 ✅ 0 💤 1 ❌
81 233 runs  81 232 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit a2d4536.

♻️ This comment has been updated with latest results.

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some minor comments from my side


# \endcond

def run_root_event_loop():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def run_root_event_loop():
def _run_root_event_loop():

I think this function is not "public API", so we can signal it in the naming convention

will be suspended until <space> key pressed by user. Simple example:
\code{.py}
\endcode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this \endcode should be placed at the end of the Python snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants