Changing size of multi line TGRadiobutton


The below example produces a window with a radio button which consists of two lines (wraped text).
However, I am unable to resize the hight of the radio button text frame, so that both text lines are only shown half. :frowning:

How can I resize the size of a radio button widget?


void Test()
// Initialize main frame;
TGTransientFrame* Main = new TGTransientFrame(gClient->GetRoot(),
gClient->GetRoot(), 500, 300);
Main->Move(200, 200);

// Add Button:
TGRadioButton* MultiLine =
new TGRadioButton(Main, “This is a very, very long text, which causes the line to wrap, but unfortunately I have no idea how to change the height of the radio button ;-(”);
MultiLine->SetHeight(50); // Doesn’t work…
TGLayoutHints* LineLayout = new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX, 20, 20, 20, 20);
Main->AddFrame(MultiLine, LineLayout);
MultiLine->SetHeight(50); // Doesn’t work…

// Bring everything to the screen

Root: v4.03/01
OS: SUSE 9.2

Hi Andreas,
unfortunately it is not possible to change the height of radio button
for a moment. Unfortunately it is not possible to have multiline labels too.
With using RootGuiBuilder I created something similar what you want
just in 5 minutes. Check the code below

Regards. Valeriy

It is quite easy to add multilining to buttons and labels …
I’ll try to add this feature before my “retirement” from ROOT team.

I will do it your way. :wink: