Code Monkey home page Code Monkey logo

Comments (4)

linev avatar linev commented on June 12, 2024

How you start python - with or without -i flag?

Graphics (normal or web) can normally works only in interactive python mode.
In such case canvas will be updated while input() is waiting for key.

In none-interactive mode events processing does not work.

from root.

linev avatar linev commented on June 12, 2024

I create separate issue #15498 concerning gPad in this script.
For me python creates second canvas - without real need.

from root.

dpiparo avatar dpiparo commented on June 12, 2024

Thanks. I do not understand. I proposed a simple reproducer that illustrates a bad user experience, very bad, that makes the system unusable. What is the strategy to fix this bug?

from root.

linev avatar linev commented on June 12, 2024

Again, workaround with calling input() function in python does not work - neither with web not with normal ROOT graphics. Only when enabling interactive python mode python - i one gets ROOT events processing working.

This problem well known and I discussed it some time ago with @vepadulano.
To make it working one need to provide special TCanvas method which only can be used in python and which properly handle ROOT events processing. Like show method in mathplotlib. Naively TCanvas::Show() can look like:

def TCanvas_Show(self) :
   # really display canvas
   self._OriginalDraw() 
   // process event until key pressed or Ctrl-C pressed
   while (not_key_press() and not_ctrl_c_pressed()):
      gROOT.ProcessEvents()

Most probably it can be introduced in _pythonization/_drawables.py.
But I am not an python/PyROOT expert and have no idea how it can be properly programmed - including keyboard/signals handling.

from root.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.