Default width of TEveBrowser

Hello,

Does anyone know which object I should be resizing / changing the default size of to change the width of the left-hand pane TEveBrowser? I have some gui elements that don’t quite fit and want to make its default a bit wider. This can be accomplished by the user dragging the edge of the TEveBrowser window, but I’d like do it automatically.

By doing:

I actually change the size of the main window, not the left-pane, which I thought was the TEveBrowser.

Thanks,

Joe

Hi Joe,

TEveBrowser inherits from TRootBrowser.

I’m not exactly sure how one would resize the left-pane from a program. Looking at class TGHSplitter and base-classes I also don’t see a method to do that (I guess one could have "move splitter N pixels to left/right). We would also need a getter method in the root-browser.

Otherwise, the frame itself is:
gEve->GetBrowser()->GetTabLeft()
but I really don’t think resizing it would be enough.

I’ll ask Bertrand to also comment on this.

Cheers,
Matevz

Hi,

This should work:

TGTab *left = gEve->GetBrowser()->GetTabLeft(); TGFrame *parent = (TGFrame *)left->GetParent(); parent->Resize(parent->GetDefaultWidth()*1.5, parent->GetDefaultHeight());
Cheers, Bertrand.

Thanks for the suggestion, sadly it has no effect for me. Perhaps I’m making some call to resize to a default size somewhere else that’s interfering? I’d love to post my entire code but it’s thousands of lines :slight_smile:

Joe

Well, indeed, it depends where you add the code… For example, adding it in $ROOTSYS/tutorials/eve/alice_esd_split.C, after line 200 works for me:

[code] […]
TEveManager::Create();

// Adapt the main frame to the screen size…
if (auto_size)
{
Int_t qq;
UInt_t ww, hh;
gVirtualX->GetWindowSize(gVirtualX->GetDefaultRootWindow(), qq, qq, ww, hh);
Float_t screen_ratio = (Float_t)ww/(Float_t)hh;
if (screen_ratio > 1.5) {
gEve->GetBrowser()->MoveResize(100, 50, ww - 300, hh - 100);
} else {
gEve->GetBrowser()->Move(50, 50);
}
}
TGTab *left = gEve->GetBrowser()->GetTabLeft();
TGFrame *parent = (TGFrame *)left->GetParent();
parent->Resize(parent->GetDefaultWidth()*1.5, parent->GetDefaultHeight());
[…]
[/code]
Cheers, Bertrand.

Bertrand, as you say putting it a bit earlier in my hierarchy seemed to do the trick.

Thanks for the help!

Joe