PROGRAM(combo);
// A text entry with a selection button that pops up a list of entries
// to choose from.
// IMG: GTK.Combo()
INHERIT(hbox);
COMPLEX_FUNCTION(create);
COMPLEX_FUNCTION(set_value_in_list, int, int);
NAME_ARGS(value_must_be_in_list,ok_if_empty);
COMPLEX_FUNCTION(set_use_arrows, int);
NAME_ARGS(use_arrows);
COMPLEX_FUNCTION(set_use_arrows_always, int);
NAME_ARGS(always_arrows);
COMPLEX_FUNCTION(set_case_sensitive, int);
NAME_ARGS(sensitivep);
COMPLEX_FUNCTION(set_item_string, item, string);
NAME_ARGS(item,text);
// The item is one of the ones in the list subwidget.
FUNCTION(set_popdown_strings, "function(array(string):object)" );
RETURNS(GTK.Combo);
NAME_ARGS(popdows_strings);
{
  GList *s = NULL;
  struct array *a;
  int i;
  get_all_args("set_popdown_strings", args, "%a", &a);
  for(i=0; i<a->size; i++)
    if(a->item[i].type == T_STRING)
      s = g_list_append( s, a->item[i].u.string->str );
  if(!s)
    error("No items in list!\n");
  gtk_combo_set_popdown_strings( GTK_COMBO( THIS->obj ), s );
  g_list_free( s );

  RETURN_THIS();
}

SIMPLE_FUNCTION(disable_activate);
SUBWIDGET(button, button);
SUBWIDGET(entry, entry);
SUBWIDGET(popup, window);
SUBWIDGET(popwin, window);
SUBWIDGET(list, list);
