A browser embeded into composite frame

Hi All,

I have a TBrowser embeded in a TGCompositeFrame,

fBrowser = new TBrowser("", "", 390, 600);

I have two questions:

  1. how do I make it resise properly when the composite frame is resised?

  2. is there a way to disable some of the TBrowser’s menu enteries, inparticular File>Close Browser?


Hi Aram,

  1. you can overload TGFrame::ConfigureNotify method for
    "compositeframe" like:
  if ((event->fWidth != fWidth) || (event->fHeight != fHeight)) {
      fWidth  = event->fWidth;
      fHeight = event->fHeight;
      TRootBrowser *b = (TRootBrowser*)fBrowser->GetBrowserImp();
      b->Resize(fWidth, fHeight);
   return kTRUE;

If you do not want to overload this method (for example in interpreted code), you can “catch” configure/resize events by TGFrame::ProcessedEvent(Event_t *event) signal
and connect it to appropriate handler function.

  1. you can do it as:
   b = (TRootBrowser*)fBrowser->GetBrowserImp();
   bar = b->GetMenuBar();
   popup = bar->GetPopup("File");
   entry = popup->GetEntry("Close Browser");

Regards. Valeriy