Web-canvas

Dears,

I’m running 6.31.01 version which uses web-canvas and I built ROOT on apple M1.

We can select either web or graphic canvas using rootrc property: Canvas.Name (respectively TWebCanvas or TRootCanvas).

I figured out that TPad::WaitPrimitive() do not act as expected (waiting for a user interaction) when displaying in the TWebCanvas. Is that normal?

Thanks

Hi,

Can you provide macro which demonstrates expected behavior?

Up to now I did not test this method with web-based canvas.

Regards,
Sergey

The very simple macro to test was this one:

#include "TCanvas.h"
#include "TF1.h"
#include "TApplication.h"

#include <iostream>
using namespace std;

int main() {

  auto A = new TApplication("a", 0,0);
  auto c = new TCanvas("c","",1400,1200);
  auto f = new TF1("f","sin(x)/x", 0., 4.);
  f->Draw();
  c->Modified();
  c->Update();
  cout << "aqui" << endl;
  c->Print("a.png");
  c->WaitPrimitive();
}

Hi,

In your macro one just waits when some (not any) action performed on the pad.
For instance - click on axis returns from waiting but click on the frame or title not.
But method WaitPrimitive potentially can do much more.

I will try to implement something with correspondent behavior on web canvas - but not identical.

Regards,
Sergey

And even worse - if one tries to activate edit mode like:

auto obj = c->WaitPrimitive("","PolyLine");

method never returns - also after stop of creation of polyline.

One need to fix method itself.

Hi,

I have simple PR with the fix for c->WaitPrimitive() call for ROOT 6.30. It will wait until double click on the frame.

More complex functionality with real edit mode will be implemented later.

Regards,
Sergey

Hi Sergey,
Just to be sure I understood:

  • you implemented a correction on version 6.30?
  • what about the master? I just dit a pull, cmake, recompiled it and the web canvas just flashes and disappear (doesn’t stop waiting for an action…)

Thanks a lot
fernando

I did not merge my changes yet.

But after applying PR c->WaitPrimitive() will block until double click in the frame.

Same fix will be applied to master and 6.30 branch.

Real editing mode I will implement later - after my vacations.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.