Repository navigation
Conversation
When drawing a canvas in a native GUI (e.g. using `tutorials/visualisation/gui/guitest.C` and Test->Dialog->Tab3), the canvas used to default to black. The workaround was `--web=off`, which is inconvenient. Implements a new method `TGuiFactory::CreateCanvasImpNative` that bypasses the `gROOT->IsWebDisplay()` check and directly returns a `TCanvasImp` as required by the native GUI. `TGuiFactory::CreateCanvasImp` receives `TCanvas *c` as a parameter. For a web canvas, the canvas ID is `111222333` (see `TWebCanvas.cxx:293`), this would be enough to determine that we do not want to create a web canvas element, but a native one instead. However, `TCanvas` is only forward declared within `TGuiFactory`, hence we cannot access its methods.
linev
left a comment
There was a problem hiding this comment.
This is wrong approach.
TGuiFactory is "native" at the moment when instantiated in the ROOT application.
And it has necessary methods to create implementation for canvas.
Code cannot work - while it only provides basic TCanvasImp instance which has no real implementation and only created in batch mode.
I see no problem with guitest.C macro - nor in master neither in the released ROOT version 6.40.x
We are follow now different strategy to extend existing TGuiFactory/TCanvasImp classes to be able provide real alternatives for current TVirtualX-based graphics and guis. See PR for such example #22736
|
I close PR as wan't merge |
are you running on linux or MacOS? I should have mentioned that I have this issue on MacOS. This is what is should look like (i.e. with the workaround This is |
|
On Mac I see no problem on master, 6.40 and 6.38 branches. Do you have special |
It was my |


When drawing a canvas in a native GUI (e.g. using
tutorials/visualisation/gui/guitest.Cand Test->Dialog->Tab3), the canvas used to default to black. The workaround was--web=off, which is inconvenient.Implements a new method
TGuiFactory::CreateCanvasImpNativethat bypasses thegROOT->IsWebDisplay()check and directly returns aTCanvasImpas required by the native GUI.TGuiFactory::CreateCanvasImpreceivesTCanvas *cas a parameter. For a web canvas, the canvas ID is111222333(seeTWebCanvas.cxx:293), this would be enough to determine that we do not want to create a web canvas element, but a native one instead. However,TCanvasis only forward declared withinTGuiFactory, hence we cannot access its methods.Checklist:
AI Disclaimer
I used AI in the debugging process, but I wrote the code myself. It is a very small edit anyway.