Hiding a frame containing certain widgets

Rutger van der Eijk (r36@nikhef.nl)
Thu, 28 May 1998 20:28:13 +0200 (MET DST)


Hi all,

I have problems hiding frames containing certain widgets. I'm not sure if
this is a root bug, that I'm doing something wrong or a that it is
a feature ... :-)

I have, for example, the following constructor of a TGMainFrame derived
class:

-----
OTGMonitorSettingsDialog::OTGMonitorSettingsDialog(const TGWindow *p,
UInt_t w, UInt_t h):
TGMainFrame(p, w, h)
{
fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);

fFrame1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame);
fCB11 = new TGCheckButton(fFrame1, new TGHotString("&check button 1.1"),
-1);
fCB12 = new TGCheckButton(fFrame1, new TGHotString("c&heck button 1.2"),
-1);
fCB11->Associate(this);
fCB12->Associate(this);
fFrame1->AddFrame(fCB11, fL1);
fFrame1->AddFrame(fCB12, fL1);

// here adding other frames to fFrame1

// fFrame1->HideFrame(fCB12);
AddFrame(fFrame1, fL1);
HideFrame(fFrame1);

// hera adding other frames to this

SetWindowName("Monitoring Settings");
SetIconName("Monitoring Settings");
MapSubwindows();
Resize(GetDefaultSize()); // this is used here to init layout algoritme
MapWindow();
}
-----

so I have a TGMainFrame containg fFrame1 and other frames. fFrame1
contains again a lot of frames, including for example also a
TGCheckButton. Now for some reason I would like to hide fFrame1. So I use
HideFrame(fFrame1). What happens is that my main frame is a bit mixed up,
it contains the other frames and also a part of the TGCheckButtons.

So it seems that the TGCheckButtons are not hiden . Now I know I can
disable buttons by setting it's state to be disabled. But I don't want it
to be disabled but hidden. Is this possible? If, yes, what am I doing
wrong? If not, why not?

Rutger van der Eijk