Re: entry box with drop down menu
- From: Thomas Mailund Jensen <mailund daimi aau dk>
- To: gtk-list redhat com
- Subject: Re: entry box with drop down menu
- Date: 10 Aug 1998 13:48:31 +0200
>>>>> "L" == Ladislav Kostal <kostal@pefstud.uniag.sk> writes:
L> Hello, In my app I need to create %subj% like in screenshot:
L> http://www.gtk.org/screenshots/entry2.gif
L> How can I do this ? I didn't found anything about it.
Take a look at gtkcombo...see the attached file for example.
/mailund
===File ~/tmp/bar.c=========================================
#include <gtk/gtk.h>
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *combo;
GList *cbitems = NULL;
char line[128];
/* initialize */
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
combo = gtk_combo_new ();
gtk_container_add (GTK_CONTAINER (window), combo);
/* get lines for combo */
while (gets (line)) {
cbitems = g_list_append(cbitems, g_strdup (line));
}
gtk_combo_set_popdown_strings (GTK_COMBO (combo), cbitems);
/* show */
gtk_widget_show_all (window);
/* main loop */
gtk_main ();
return 0;
}
============================================================
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]