Re: TButton title

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Dec 16 1997 - 14:15:33 MET


Laurent Aphecetche wrote:

> Hi again, and thanks for the fast answer on the previous question !
>
> I want to make a toggle button (i.e. a button which title change when you press it) but there is no TButton::SetTitle routine (but a TNamed one), so the "Text" primitive of TButton is not updated. Is there another way to do this ?
>

If you have an object TButton *button, then the procedure to update the text in the button
can be the following:
    TText *btext = (TText*)button->GetListOfPrimitives()->First();
    btext->SetTitle("New button title");
    button->Modified();
    button->Update();

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET