TGComboBox::Select (char*)?

Hello ROOT!!! :smiley::D:D
So in TGComboBox there is one function:

virtual void  Select(Int_t id);

which is calling another function called:

virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } // *SIGNAL*

where for the same function with char*

virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } // *SIGNAL*

there is no corresponding Select (char*) function which at least for me
makes this function unusable. I’ll give as an example the case where you have
combo box with char* then you want to set initial value: the only way is
through Select(int) which means that there is no signal Selected(char*) emitted
so I have explicitly to write Selected (char* …) but this is a bit dummy because
I’ve already have Selected (int) signal. Thats my point. So my question is it
worth the effort to implement Select (char*)?

Hi Jimmy,

Signals are emitted by objects when they change their state in a way that may be interesting to the outside world. This is all an object does to communicate and it does not know if anything is receiving the signal at the other end. The signal Selected(const char txt) does not require explicitly the existance of method Select (char). It only gives the possibility for users to get the information of the selected text entry as a parameter and to perform an action according to that information.

Cheers, Ilka

Yes for sure one can live without Select (char*) this was more or less a cosmetic
question because there are two signals int and char* but only one function for
emiting the int signal and no function for emiting the char* signal. Just for completeness.

Hi Jimmy,

The signal Selected(const char*) is emitted in the TGComboBox::ProcessMessage method for the TGTextLBEntry objects (what makes sense).

Cheers, Ilka

Hi Ilka yes but if you want to have for example the contents in the combo box writen for example in the status bar when it’s selected (not with the mouse or with some other way which is generating event) like when you have Select (0) than ProcessMessage will not help and the only way is through Connect.

Probably this discussion is too philosophical probably I didn’t have to post it I can live without Select (char*).

Hi Jimmy,

My previous posting was related of what you said (included below),[quote]there are two signals int and char* but only one function for emiting the int signal and no function for emiting the char* signal. Just for completeness.[/quote] I will repeat again that the signal Selected(const char*) is emitted in the TGComboBox::ProcessMessage method for combo boxes with text entries (TGTextLBEntry). There is no need of the Select(const char ) method for emitting the signal Selected(const char). The important thing is to emit a correct signnal any time an object changes its state - what is done in the code of TGComboBox class.

Cheers, Ilka