Re: [gtk-list] entry box with drop down menu

Ladislav Kostal wrote:
> Hello,
> In my app I need to create %subj% like in screenshot:
> How can I do this ? I didn't found anything about it.

It's a GtkCombo...

GtkWidget *w = gtk_combo_new();

It's a composite widget, and the two children that you need to
deal with are a GtkEntry, and a GtkList.

You can set the strings in the popdown menu with this call :

gtk_combo_set_popdown_strings(GtkCombo *combo, GList *strings);

You can connect to the "changed" signal of the entry to find out
when the user has selected a new item.

		   (GtkSignalFunc) myComboCallback, (gpointer) some_data);

You might also want to set the entry to not allow the user to type/edit
the text in it.


As long as you understand GLists, that should be all you need.

Ben Boule

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