Refreshing ROOT gui frame after modifying elements

From: suvayu ali <fatkasuvayu_at_gmail.com>
Date: Tue, 15 May 2012 16:39:25 +0200


Hi,

I am working on a GUI written using ROOT. I want to add TGHorizontalFrames to a tab with other TGHorizontalFrames and a TRootEmbeddedCanvas depending on context. I try to do this from a method by calling

  tab->RemoveFrame(canvas);

  horizframe1 = new TGHorizontalFrame(..);   horizframe2 = new TGHorizontalFrame(..);

  tab->AddFrame(horizframe1);
  canvas->Resize(origw, origh - <some no>);   tab->AddFrame(canvas);
  tab->AddFrame(horizframe2);

But my problem is the new horizontal frames are positioned at x=0, y=0 and not after the already existing horizontal frame in the tab. I know this by printing the fames.

TGCompositeFrame: id=100664561 parent=100663488 x=2 y=23 w=1373 h=566

   TGHorizontalFrame: id=100664562 parent=100664561 x=81 y=2 w=1211 h=33
...

   TGHorizontalFrame: id=100665125 parent=100664561 x=0 y=0 w=1211 h=33
...

   TRootEmbeddedCanvas: id=100664582 parent=100664561 x=10 y=47 w=1353 h=337    TGHorizontalFrame: id=100665127 parent=100664561 x=0 y=0 w=1211 h=33
...

What am I doing wrong, and where can I find more documentation?

Thanks,

PS: This is a GUI used in the LHCb colaboration, so I can't reasonably

    simplify the problem into a test macro. I could point you to the     code though.

-- 
Suvayu

Open source is the future. It sets us free.
Received on Tue May 15 2012 - 16:39:52 CEST

This archive was generated by hypermail 2.2.0 : Tue May 15 2012 - 17:50:01 CEST