1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
/* -*- C -*- */ 
class GTK2.ToggleButton; 
inherit GTK2.Button; 
 
//! Toggle buttons are derived from normal buttons and are very 
//! similar, except they will always be in one of two states, 
//! alternated by a click. They may be depressed, and when you click 
//! again, they will pop back up. Click again, and they will pop back 
//! down. 
//! <p> 
//! IMG: GTK2.ToggleButton("Toggle button") 
//! IMG: GTK2.ToggleButton("Toggle button")->set_active( 1 ) 
//! </p> 
 
//! Properties: 
//! int active 
//! int draw-indicator 
//! int inconsistent 
 
signal toggled; 
 
void create(string|mapping|void label_or_props, ?int mnemonic) 
//! If you supply a string, a label will be created and inserted in the button. 
//! Otherwise, use -&gt;add(widget) to create the contents of the button. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    struct pike_string *t; 
    GtkWidget *gt; 
    INT_TYPE nem=0; 
 
    if (TYPEOF(Pike_sp[-1]) == PIKE_T_STRING) { 
      get_all_args(NULL,args,"%T.%i",&t,&nem); 
      if (t) { 
        ref_push_string(t); 
        f_string_to_utf8(1); 
        if (nem) 
          gt=gtk_toggle_button_new_with_mnemonic(CGSTR0(Pike_sp[-1].u.string)); 
        else 
          gt=gtk_toggle_button_new_with_label(CGSTR0(Pike_sp[-1].u.string)); 
        pop_stack(); 
      } else 
        gt=gtk_toggle_button_new(); 
      THIS->obj=G_OBJECT(gt); 
    } else { 
      INIT_WITH_PROPS(GTK_TYPE_TOGGLE_BUTTON); 
    } 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkWidget *gt; 
    gt=gtk_toggle_button_new(); 
    THIS->obj=G_OBJECT(gt); 
  } 
  pgtk2__init_this_object(); 
} 
 
void set_mode(int mode); 
//! If true, draw indicator 
 
int get_mode(); 
//! Retrieves whether the button is displayed as a separator indicator and 
//! label. 
 
int get_active(); 
//! Returns true if button is pressed, and false if it is raised. 
 
void set_active(int activep); 
//! If activep is true, the toggle button will be activated. 
 
int get_inconsistent(); 
//! Gets the value set by set_inconsistent(). 
 
void set_inconsistent(int setting); 
//! If the user has selected a range of elements (such as some text or 
//! spreadsheet cells) that are affected by a toggle button, and the current 
//! values in that range are inconsistent, you may want to display the toggle 
//! in an "in between" state.  This function turns on "in between" display. 
 
void toggled(); 
//! emulate a 'toggle' of the button. This will emit a 'toggled' signal.