Beginner's question: Combo widget



Hi!

	Is the combo widget no longer used? I have GTK+ 1.1.2 and I am
trying to learn how to use different widgets. I stumbled over the Combo
widget.
	Since there is no example for it, here's the code I cooked up in
my test program:

  GtkWidget * dropdown = gtk_combo_new();
  GList * ddlist = 0;
  ddlist = g_list_prepend( ddlist, gtk_list_item_new_with_label( "G" ) );
  ddlist = g_list_prepend( ddlist, gtk_list_item_new_with_label( "B" ) );
  ddlist = g_list_prepend( ddlist, gtk_list_item_new_with_label( "M" ) );
  gtk_list_prepend_items( GTK_LIST( GTK_COMBO( dropdown )->list ), ddlist
);
  gtk_box_pack_start( GTK_BOX( vb ), GTK_WIDGET( dropdown ),
		      FALSE, FALSE, 0 );
  gtk_widget_show( dropdown );

It shows up on the screen, and, using the keyboard, I can cycle through
the items in the Combo widget. But if I click the drop down button on the
right, and empty list show up.

If I use gtk_combo_set_popdown_strings instead of gtk_list_prepend_items
(and with changed arguments), I get the same result: empty list, but
keyboard-cycling works fine.

What am I missing? What am I doing wrong?

TIA,

Mihai




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