eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson require gtk24; class GTK2.RadioAction; inherit GTK2.ToggleAction; //! Properties
f284492006-08-03Lance Dillon require gtk210; //! int current-value endrequire;
1a05542005-07-28Martin Nilsson //! GTK2.RadioAction group //! int value signal changed;
3d76632005-11-03Lance Dillon void create(string|mapping(string:mixed) name_or_props, ?string label, ?string tooltip, ?string stock_id, ?int value)
1a05542005-07-28Martin Nilsson //! Creates a new GTK2.ToggleAction object.
3d76632005-11-03Lance Dillon {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
3d76632005-11-03Lance Dillon  if (args==4) {
535ddd2005-12-18Marcus Comstedt  char *name,*stock_id; struct pike_string *label, *tooltip;
eac9aa2005-12-18Martin Nilsson  gchar *label2=NULL, *tooltip2=NULL;
535ddd2005-12-18Marcus Comstedt  INT_TYPE val;
3d76632005-11-03Lance Dillon  GtkRadioAction *gr;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%s%t%t%s%i",&name,&label,&tooltip,&stock_id,&val);
535ddd2005-12-18Marcus Comstedt  if(label) { ref_push_string(label); f_string_to_utf8(1);
eac9aa2005-12-18Martin Nilsson  label2 = GSTR0(Pike_sp[-1].u.string);
535ddd2005-12-18Marcus Comstedt  } if(tooltip) { ref_push_string(tooltip); f_string_to_utf8(1);
eac9aa2005-12-18Martin Nilsson  tooltip2 = GSTR0(Pike_sp[-1].u.string);
535ddd2005-12-18Marcus Comstedt  } gr=gtk_radio_action_new(name,label2,tooltip2,stock_id,val); if(tooltip) pop_stack(); if(label) pop_stack();
3d76632005-11-03Lance Dillon  THIS->obj=G_OBJECT(gr); } else { INIT_WITH_PROPS(GTK_TYPE_RADIO_ACTION); }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args); pgtk2__init_this_object();
3d76632005-11-03Lance Dillon }
1a05542005-07-28Martin Nilsson  array(GTK2.RadioAction) get_group() //! Returns the list representing the radio group. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited(); pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  {
cc0b572008-01-22Henrik Grubbström (Grubba)  GSList *gsl;
1a05542005-07-28Martin Nilsson  int i=0;
cc0b572008-01-22Henrik Grubbström (Grubba)  gsl=gtk_radio_action_get_group(GTK_RADIO_ACTION(THIS->obj)); while (gsl) { push_gobject(gsl->data); g_object_ref(gsl->data);
1a05542005-07-28Martin Nilsson  i++;
cc0b572008-01-22Henrik Grubbström (Grubba)  gsl=g_slist_next(gsl);
1a05542005-07-28Martin Nilsson  } f_aggregate(i); } } void set_group(GTK2.RadioAction member) //! Sets the radio group. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited();
1a05542005-07-28Martin Nilsson  { GSList *gl; struct object *o1;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%o",&o1);
1a05542005-07-28Martin Nilsson  gl=gtk_radio_action_get_group(GTK_RADIO_ACTION(get_gobject(o1))); gtk_radio_action_set_group(GTK_RADIO_ACTION(THIS->obj),gl); } RETURN_THIS(); } int get_current_value(); //! Obtains the value property of the currently active member.
f284492006-08-03Lance Dillon require gtk210; void set_current_value(int value); //! Sets the currently active group member to the member with value property //! value. endrequire;
1a05542005-07-28Martin Nilsson endrequire;