A simple example that shows the enabled and disabled state of a button group with radio and check buttons.
class IDList {
private:
public:
IDList() : nID(0) {}
~IDList() {}
Int_t GetUnID(
void) {
return ++nID; }
};
private:
IDList IDs;
public:
virtual ~MyButtonTest();
void DoExit(void);
};
{
Connect("CloseWindow()", "MyButtonTest", this, "DoExit()");
DontCallClose();
IDs.GetUnID());
1, 1, 1, 1));
IDs.GetUnID());
IDs.GetUnID());
IDs.GetUnID());
IDs.GetUnID());
IDs.GetUnID());
fButtonGroup->Show();
1, 1, 1, 1));
AddFrame(fHL2);
fCheckb[0]->
Connect(
"Toggled(Bool_t)",
"MyButtonTest",
this,
"SetGroupEnabled(Bool_t)");
fExit->
Connect(
"Clicked()",
"MyButtonTest",
this,
"DoExit()");
fButtonGroup->SetState(
kTRUE);
SetWindowName("My Button Group");
MapSubwindows();
Resize(GetDefaultSize());
MapWindow();
fButtonGroup->SetRadioButtonExclusive(
kTRUE);
};
MyButtonTest::~MyButtonTest()
{
Cleanup();
}
void MyButtonTest::DoExit()
{
}
void MyButtonTest::SetGroupEnabled(
Bool_t on)
{
fButtonGroup->SetState(on);
}
void buttongroupState()
{
new MyButtonTest(
gClient->GetRoot(),100,100);
}
- Author
- Roel Aaij 4/07/2007
Definition in file buttongroupState.C.