eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.CheckButton; inherit GTK2.ToggleButton; //! Check buttons inherent many properties and functions from the the //! toggle buttons, but look a little different. Rather than //! being buttons with text inside them, they are small squares with //! the text to the right of them. These are often used for toggling //! options on and off in applications.
27a6df2006-01-05Marcus Comstedt //! IMG: GTK2.CheckButton( "title" )
1a05542005-07-28Martin Nilsson  //! Style properties: //! int indicator-size //! int indicator-spacing
c3d1062006-02-02Lance Dillon void create(string|mapping|void label_or_props, ?int mnemonic)
1a05542005-07-28Martin Nilsson //! The argument, if specified, is the label of the item. //! If no label is specified, use object->add() to add some //! other widget (such as an pixmap or image widget) {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
1a05542005-07-28Martin Nilsson  if (args) {
017b572011-10-28Henrik Grubbström (Grubba)  if (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING) {
3d76632005-11-03Lance Dillon  struct pike_string *t; GtkWidget *gcb;
c3d1062006-02-02Lance Dillon  INT_TYPE nem=0;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%T.%i",&t,&nem);
3d76632005-11-03Lance Dillon  if (t) {
c6e2972005-12-17Marcus Comstedt  ref_push_string(t); f_string_to_utf8(1);
c3d1062006-02-02Lance Dillon  if (nem) gcb=gtk_check_button_new_with_mnemonic(CGSTR0(Pike_sp[-1].u.string)); else gcb=gtk_check_button_new_with_label(CGSTR0(Pike_sp[-1].u.string));
c6e2972005-12-17Marcus Comstedt  pop_stack();
3d76632005-11-03Lance Dillon  } else gcb=gtk_check_button_new(); THIS->obj=G_OBJECT(gcb); } else { INIT_WITH_PROPS(GTK_TYPE_CHECK_BUTTON); }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  } else {
3d76632005-11-03Lance Dillon  GtkWidget *gcb; gcb=gtk_check_button_new(); THIS->obj=G_OBJECT(gcb);
1a05542005-07-28Martin Nilsson  }
ba9e802006-02-27Martin Stjernholm  pgtk2__init_this_object();
1a05542005-07-28Martin Nilsson }