# Dynamic Content in Gtk::ComboBox list

**URL:** <https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123>\
**Category:** Ruby-Gnome 2\
**Created:** [February 1, 2007, 5:44pm UTC](https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123 "2007-02-01T17:44:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhstudio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Post date:** [February 1, 2007, 5:44pm UTC](https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123/1 "2007-02-01T17:44:40Z")

</div>

Hello all,

I’d like to have the contents of my Gtk::ComboBox list updated  
whenever the popup list is shown. I’m using the simple text-only  
way of working with the combo box.

I’ve tried to listen to every signal I think might do it, but none  
seem to be sent when the popup is about to be popped-up.

What signal should I be listening to? Or is there a better  
way to do this?

I’m using Gtk 2.8.18 and ruby-gtk2-0.14-1 on windows.

Thank you,  
Martin

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![dhstudio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Post date:** [February 1, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123/2 "2007-02-01T18:51:46Z")

</div>

It would be easyer for you if you use the glde interface designer  
[http://gladewin32.sourceforge.net/modules/wfdownloads/visit.php?cid=2&lid=105](http://gladewin32.sourceforge.net/modules/wfdownloads/visit.php?cid=2&lid=105)  
but to answer your question i think you can use the GtkWidget  
button-press-event

But as i was saying you can use glade to design your gui and apply any  
signals you need  
then just use this command here  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?ruby-glade-create-template](http://ruby-gnome2.sourceforge.jp/hiki.cgi?ruby-glade-create-template) to  
generate a skeleton  
templet and then you can add any ruby code you want to that.

---

<div class="post-metadata">

**Author:** ![dhstudio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Post date:** [February 1, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123/3 "2007-02-01T20:21:54Z")

</div>

Martin P. wrote:

> way to do this?
> 
> I’m using Gtk 2.8.18 and ruby-gtk2-0.14-1 on windows.

have you tried Gtk::EventBox ?  
you might get more signals there.

---

<div class="post-metadata">

**Author:** ![dhstudio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Post date:** [February 2, 2007, 12:47pm UTC](https://www.ruby-forum.com/t/dynamic-content-in-gtk-combobox-list/84123/4 "2007-02-02T12:47:21Z")

</div>

Dobai-Pataky Bálint wrote:

> Martin P. wrote:

> > I’d like to have the contents of my Gtk::ComboBox list updated  
> > whenever the popup list is shown.

> have you tried Gtk::EventBox ?  
> you might get more signals there.

Thanks. Wrapping ComboBox in an EventBox and using enter-notify-event  
to populate the list gets the job done.

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)
