Re: Re: combo box events



Damon Chaplin wrote:

>Bob P wrote:
>> 
>> I have a combo box in my program, and i would like
to update a few
>> labels when the selection is changed.  The problem
is, i have no idea
>> which signal to capture.  I want to create a
callback, so whenever the
>> you click the down arrow then click on a selection,
it raises an event.
>>  I could then change the labels to reflect the new
selection.

>Connect to the "changed" signal from the GtkEntry
>inside the GtkCombo.
>e.g.

What i'd really like to do is capture events from the
dropdown menu, and make the entry either uneditable or
have autocompletion.  That way the user _must_ select
something predefined.
                      
>  gtk_signal_connect (GTK_OBJECT (GTK_COMBO
(combo)->entry), "changed",
>                      GTK_SIGNAL_FUNC
(on_combo_entry_changed),
>                      NULL);

> Damon

I tried:
GtkWidget *cboModem;

...

cboModem = lookup_widget(FMain, "cboModem");
gtk_signal_connect
(GTK_OBJECT(GTK_COMBO(cboModem).entry), "changed",
GTK_SIGNAL_FUNC(on_combo_entry_changed), NULL);

It should also be noted that i'm using Glade, and come
from a VB background (explains the naming convention).

thx in advance again,
Bob

------
(/me was surprised to get a response after only 2
hours)

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]