# Question about gtk.ComboBoxEntry

**URL:** <https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382>\
**Category:** Ruby\
**Created:** [August 6, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382 "2007-08-06T17:58:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [August 6, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382/1 "2007-08-06T17:58:42Z")

</div>

hello there all,

i cannot seem to find how to set the active text in a gtk.ComboBoxEntry.  
i can populate it with a list of items using the append\_text(item)  
method.  
but i cannot seem to find how to actually set the item i want to be  
active.

thanks for any tips

shawn

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [August 6, 2007, 7:05pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382/2 "2007-08-06T19:05:50Z")

</div>

Am Dienstag, den 07.08.2007, 00:57 +0900 schrieb shawn bright:

> hello there all,
> 
> i cannot seem to find how to set the active text in a gtk.ComboBoxEntry.  
> i can populate it with a list of items using the append\_text(item) method.  
> but i cannot seem to find how to actually set the item i want to be active.
> 
> thanks for any tips
> 
> shawn

Hi

your\_combo\_box\_entry.active = x

Cheers  
detlef

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [August 6, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382/3 "2007-08-06T19:28:54Z")

</div>

thanks !

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [August 8, 2007, 3:10pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382/4 "2007-08-08T15:10:02Z")

</div>

shawn bright wrote:

> i cannot seem to find how to set the active text in a gtk.ComboBoxEntry.  
> i can populate it with a list of items using the append\_text(item) method.  
> but i cannot seem to find how to actually set the item i want to be active.

look in the superclass:  
Gtk::ComboBox.set\_active( index )

but you have to work out index yourself, rather than passing in  
the text item.

ruby-gnome2 has its own mailing list which is more suited for  
questions like this:  
[ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

martin.

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [August 8, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/question-about-gtk-comboboxentry/111382/5 "2007-08-08T18:27:07Z")

</div>

thanks for the tip on the mailing list, joining now.  
thanks for the tips

shawn
