# TGComboBox::Select (char\*)?

**URL:** <https://root-forum.cern.ch/t/tgcombobox-select-char/2661>\
**Category:** ROOT\
**Created:** [November 20, 2005, 7:38pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661 "2005-11-20T19:38:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimitar\_panayotov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@dimitar\_panayotov](https://root-forum.cern.ch/u/dimitar_panayotov)\
**Post date:** [November 20, 2005, 7:38pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/1 "2005-11-20T19:38:30Z")

</div>

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

```auto
virtual void Select(Int_t id);
```

which is calling another function called:

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

where for the same function with char\*

```auto
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\*)?

---

<div class="post-metadata">

**Author:** ![antcheva](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c5a1d2/32.png) [@antcheva](https://root-forum.cern.ch/u/antcheva)\
**Post date:** [November 21, 2005, 8:23am UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/2 "2005-11-21T08:23:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dimitar\_panayotov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@dimitar\_panayotov](https://root-forum.cern.ch/u/dimitar_panayotov)\
**Post date:** [November 25, 2005, 3:44pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/3 "2005-11-25T15:44:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![antcheva](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c5a1d2/32.png) [@antcheva](https://root-forum.cern.ch/u/antcheva)\
**Post date:** [November 25, 2005, 3:54pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/4 "2005-11-25T15:54:52Z")

</div>

Hi Jimmy,

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

Cheers, Ilka

---

<div class="post-metadata">

**Author:** ![dimitar\_panayotov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@dimitar\_panayotov](https://root-forum.cern.ch/u/dimitar_panayotov)\
**Post date:** [November 25, 2005, 4:39pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/5 "2005-11-25T16:39:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dimitar\_panayotov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@dimitar\_panayotov](https://root-forum.cern.ch/u/dimitar_panayotov)\
**Post date:** [November 25, 2005, 9:30pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/6 "2005-11-25T21:30:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![antcheva](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c5a1d2/32.png) [@antcheva](https://root-forum.cern.ch/u/antcheva)\
**Post date:** [November 26, 2005, 12:25pm UTC](https://root-forum.cern.ch/t/tgcombobox-select-char/2661/7 "2005-11-26T12:25:21Z")

</div>

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
