gtk_combo behavior



Hi all,

I have a gtk_combo that I am using basically exactly as described in the
tutorial.  It semi-works, or rather works as far as is specified, but is
annoying to use.  Let me describe it:

If the operator types in a value and hits enter, my callback gets the
"activate" signal and responds accordingly, reading the text from the
entry associated with the combo.  Annoyingly, the list of choices pops
up in the window, as if the little triangle was clicked.  The operator
has to hit ESC, or click elsewhere, to make this go away.  How can I
prevent this?

Worse, when an operator clicks the little triangle, and then selects one
of the choices, the entry text changes (which would make the operator
suspect that the action had occurred), but my "activate" signal handler
is not called.  If the operator then hits enter, it gets called, but
then the list pops up again.  I suspect that I need to attach a
"select_child" signal handler, which will act as if an "activate" for
the entry was done, but the order in which things need to happen is not
clear to me.  E.g., when the "select_child" signal handler is called,
will the widget's own behavior of putting the text into the combo->entry
widget already have occurred?

I looked into testgtk and (one combo inside of) glade, and they have the
same annoying behavior for gtk_combo's.  Neither of my Gtk/Gnome books,
nor GGAD, seem to have any advice on this.

Can anyone suggest how to get the nice behavior operators will expect? 
Or point me toward some example code that does so?  That typing into the
entry gets behavior like an entry, but that selecting a choice is
identical to having types that choice and hit enter?

Thanks in advance,

Eric M. Monsler




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