ilomi
January 26, 2020, 11:23pm
1
_ROOT Version: 6.18/04
_Platform: Linux Kubuntu
_Compiler: VS Code
I can’t set the coordinates of the ControlBar
{
Int_t w = 4000;
Int_t h = 200;
TControlBar *cb = new TControlBar("vertical", "Initialisation", w, h);
cb->AddButton("test", "int k = 2; cout << k << endl;", "test");
cb->AddButton("quit", ".q;", "quit test");
cb->Show();
}
Add those lines after cb->Show();
:
TRootControlBar *rcb = (TRootControlBar *)cb->GetControlBarImp();
rcb->Move(1200, 800); // or any x,y values
1 Like
ilomi
January 27, 2020, 10:12am
3
Thank you. It works perfectly.
Can you give me a brief explanation why it didn’t work or how you figured it out (solution).
1 Like
TControlBar
is actually not the window you see on screen. What you see is a TRootControlBar
(which is what gets returned by GetControlBarImp()
)
1 Like
ilomi
January 27, 2020, 10:38am
5
1 more question and done…
For what are than w and h for in constructor (or just in general Int_t x, and Int_t h)
TControlBar *cb = new TControlBar("vertical", "Initialisation", w, h);
Looking at the TControlBar class documentation , I would say it should be the initial position of the control bar, multiplied by the screen factor, whatever that means…