Re: [Re: [Re: how to get text from combo box]]



alprach wrote:
> hi, i am trying to catch the list item in combo widget using "changed"
> signal hooked to GTK_ENTRY(GTK_COMBO(combo)->entry) it is working fine
> for 2 selections from the list of items in a combo box.. but for the
> 3rd click it is not working.. it gives segmentation error...(is due to
> some memory problem) i really don't know anything... thanks,

I found the most reliable way (but a bit hacky) to get combo changes was
to catch "hide" from the popup:

--
  GtkWidget *popwin = GTK_COMBO (combo)->popwin;
  gtk_signal_connect (GTK_OBJECT (popwin), "hide",
                      GTK_SIGNAL_FUNC (my_code),
                      (gpointer) my_data);
--

Now in my_code(), just read the contents of the combo entry. You'll just
get selects from the list, you won't see any keyboard stuff. Catch
"activate" from the entry to see when someone edits and presses return.

HTH, John
--
John Cupitt, john cupitt ng-london org uk, +44 (0)20 7747 2570
VASARI Lab, The National Gallery, Trafalgar Square, London, WC2N 5DN




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