AddButton function when writing a GUI

Hi ROOTers,

I find that the declaration of TControlBar::AddButton() can be like “void TControlBar::AddButton ( const char* label, const char* action, const char* hint = “”, const char* type = “button”)”
I wonder what are the other options of the argument “type”. I have no idea where to find such information.

I am to write a GUI so that I can input a number as an argument for another macro and then click a button to run that macro. But I don’t know how to change the plain button into a textbox so that I can set the number. Can I use TControlBar::AddButton() to make it?


No, see TControlBarButton::SetType().
If you need complex GUI widgets, you can use the ones in $(ROOTSYS)\macros\Dialogs.C or create your own (you can take a look at examples in $(ROOTSYS)\tutorials\gui)

Thanks. Now I solve this by loading the “Dialog.C” and add a button in my macro to run the GetIntegerDialog function, so as to set value of a variable. (However, this needs two dialog boxes rather than a single one.)

Note that you can create your own dialog…

Yeah I see. I try to learn about TGWidget and so on, and write a class to accomplish that. Thanks for your help!