Re: ComboBox signals



David Sword said:
Hi
I have a combobox in my application which is set to $editable(FALSE), as
I only want users to select an item from the drop down list.  The action
of selecting then uses a callback to load data from the database!

I have tried the 'activate' signal, but it only calls the callback if
the enter key is pressed within the combobox, and the changed signal
seems to generate 2 calls to the callback, with only the second of these
containing any data in $combo->entry->get_text.  This obviously
generates chaos within the application, and the database.

Am I missing something obvious? (most likely!)

based on what you're describing you may be better off using a GtkOptionMenu,
look in examples/simplelist.pl for an example of its usage. when people see a
combobox they expect to be able to edit it, and not being able to is
confusing.
take a look at it here:
http://developer.gnome.org/doc/API/2.0/gtk/GtkOptionMenu.html there are plenty
of signals to connect to (on it's ancestors, namely, button.)

Also, the combobox uses a list, which is deprecated - will the combobox
also be deprecated, or is a new replacement on the way?  If it will be
obsolete, I don't want to build a lot oif code around it - what should I
use instead (I generally want users to select an item from a drop down
list, rather than give huge amounts of screen space to a scrolled list).

there's no danger of list coming out for this very reason. in fact the only
reason that list is bound is so that combo boxes can be used. look for much
improved replacements when gtk+-2.3 comes out.

Sorry for the mass of questions, but you guys just know SOOOO MUCH about
this stuff, and I dont!

that's what this list is for.

-rm



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