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
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
122
  
123
  
124
  
125
  
126
  
127
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
153
  
154
  
155
  
156
  
157
  
158
  
159
  
160
  
161
  
162
  
163
  
164
  
165
  
166
  
167
  
168
  
169
  
170
  
171
  
172
  
173
  
174
  
175
  
176
  
177
  
178
  
179
  
180
  
181
  
182
  
183
  
184
  
185
  
186
  
187
  
188
  
189
  
190
  
191
  
192
  
193
  
194
  
195
  
196
  
197
  
198
  
199
  
200
  
201
  
202
  
203
  
204
  
205
  
206
  
207
  
208
  
209
  
210
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
/* -*- C -*- */ 
class GTK2.Notebook; 
inherit GTK2.Container; 
 
//! The NoteBook Widget is a collection of 'pages' that overlap each 
//! other, each page contains different information. This widget has 
//! become more common lately in GUI programming, and it is a good way 
//! to show blocks similar information that warrant separation in their 
//! display. 
//! 
//! IMG: GTK2.Notebook()->set_tab_pos(GTK2.POS_LEFT)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3")) 
//! IMG: GTK2.Notebook()->set_tab_pos(GTK2.POS_TOP)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3")) 
//! IMG: GTK2.Notebook()->set_tab_pos(GTK2.POS_RIGHT)->append_page(GTK2.Label("Page 1\nContents"),GTK2.Label("Page 1"))->append_page(GTK2.Label(""),GTK2.Label("Page 2"))->append_page(GTK2.Label("Page 3 contents\nare here!"),GTK2.Label("Page 3"))->next_page()->next_page() 
 
//! Properties: 
//! int enable-popup 
//! int homogeneous 
//! int page 
//! int scrollable 
//! int show-border 
//! int show-tabs 
//! int tab-border 
//! int tab-hborder 
//! int tab-pos 
//! int tab-vborder 
//! <p> 
//! Child properties: 
//! string menu-label 
//! int position 
//! int tab-expand 
//! int tab-fill 
//! string tab-label 
//! int tab-pack 
//! <p> 
require gtk24; 
//! Style properties: 
//! int has-backward-stepper 
//! int has-forward-stepper 
//! int has-secondary-backward-stepper 
//! int has-secondary-forward-stepper 
require gtk210; 
//! int tab-curvature 
//! int tab-overlap 
endrequire; 
endrequire; 
 
signal change_current_page; 
signal focus_tab; 
signal move_focus_out; 
signal select_page; 
signal switch_page; 
//! Called when a different page is selected 
 
void create(?mapping(string:mixed) props) 
//! Create a W(Notebook) widget with no pages. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    INIT_WITH_PROPS(GTK_TYPE_NOTEBOOK); 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkWidget *gn; 
    gn=gtk_notebook_new(); 
    THIS->obj=G_OBJECT(gn); 
  } 
  pgtk2__init_this_object(); 
} 
 
void append_page(GTK2.Widget contents, ?GTK2.Widget label); 
//! Add a new 'page' to the notebook. The first argument is the contents of 
//! the page, the second argument is the label. 
 
void append_page_menu(GTK2.Widget contents, 
                     ?GTK2.Widget label, 
                     ?GTK2.Widget menu); 
//! Add a new 'page' to the notebook. The first argument is the 
//! contents of the page, the second argument is the label, the third 
//! argument is a menu label widget. 
 
void prepend_page(GTK2.Widget contents, ?GTK2.Widget label); 
//! Add a page at the end of the list of pages. The first argument is 
//! the contents of the page, the second argument is the label. 
 
void prepend_page_menu(GTK2.Widget contents, ?GTK2.Widget label, 
                      ?GTK2.Widget menu); 
//! Add a new 'page' at the end of the list of pages. The first 
//! argument is the contents of the page, the second argument is the 
//! label, the third argument is a menu label widget. 
 
void insert_page(GTK2.Widget contents, GTK2.Widget label, int pos); 
//! Insert a page at the specified location, arguments as for 
//! append_page, but an aditional integer specifies the location. 
 
void insert_page_menu(GTK2.Widget contents, GTK2.Widget label, 
                      GTK2.Widget menu, int pos); 
//! Insert a page at the specified location, arguments as for 
//! append_page_menu, but an additional integer specifies the location. 
 
void remove_page(int pos); 
//! Remove a page. 
 
int get_current_page(); 
//! Returns the index of the currently selected page 
 
int page_num(GTK2.Widget widget); 
//! Returns the index for the specified page. 
 
+GTK2.Widget get_nth_page( int index ); 
//!  Returns the page for the specified index 
 
void set_current_page(int pos); 
//! Go to the specified page 
 
require gtk210; 
void set_group_id(int id); 
//! Sets an group identifier for notebook; notebooks sharing the same group 
//! identifier will be able to exchange tabs via drag and drop. A notebook 
//! with group identifier -1 will not be able to exchange tabs with any other 
//! notebook. 
 
int get_group_id(); 
//! Gets the current group identifier. 
endrequire; 
 
void next_page(); 
//! Go to the next page 
 
void prev_page(); 
//! Go to the previous page 
 
void reorder_child(GTK2.Widget child, int position); 
//! Reorders the page containing child, so that it appears at 
//! position. 
 
void set_tab_pos(int pos); 
//! Sets the edge at which the tabs for switching pages in the 
//! notebook are drawn. 
//! One of CONST(GTK_POS) 
 
void set_show_tabs(int showtabsp); 
//! If supplied with a true value, the tabs will be shown. Otherwise 
//! they will not be shown. The user will not be able to select the 
//! pages without them, but you can add 'next' and 'previous' buttons 
//! to create a wizard-line interface. 
 
void set_show_border(int showborderp); 
//! If true, show the borders around the contents and tabs. 
 
void set_scrollable(int scrollablep); 
//! If true, add scrollbars if necessary. 
 
void popup_enable(); 
//! Enable the popup menu (set with insert_page_menu). 
 
void popup_disable(); 
//! Disable the popup menu (set with insert_page_menu). 
 
+GTK2.Widget get_menu_label(GTK2.Widget page); 
//! Retrieves the menu label widget of the page containing child. 
 
require gtk22; 
int get_n_pages(); 
//! Get the number of pages. 
endrequire; 
 
+GTK2.Widget get_tab_label(GTK2.Widget page); 
//! Returns the tab label widget. 
 
void set_menu_label(GTK2.Widget child, GTK2.Widget label); 
//! Changes the menu label for the page containing child. 
 
void set_menu_label_text(GTK2.Widget child, string label_text); 
//! Creates a new label with label_text sets it as the menu label. 
 
void set_tab_label(GTK2.Widget child, GTK2.Widget label); 
//! Changes the tab label for child. 
 
void set_tab_label_packing(GTK2.Widget child, int expand, int fill, int type); 
//! Sets the packing parameters for the tab label of the page child. 
 
void set_tab_label_text(GTK2.Widget child, string title); 
//! Creates a new label and sets it as the tab label for the page 
//! containing child. 
 
string get_menu_label_text(GTK2.Widget child); 
//! Retrieves the text of the menu label for the page containing child. 
 
+GTK2.Widget get_menu_label(GTK2.Widget page); 
//! Return the menu label widget. 
 
int get_scrollable(); 
//! Returns whether the tab label area has arrows for scrolling. 
 
int get_show_border(); 
//! Returns whether a bevel will be drawn around the pages. 
 
int get_show_tabs(); 
//! Returns whether the tabs of the notebook are shown. 
 
string get_tab_label_text(GTK2.Widget child); 
//! Retrieves the text of the tab label for the page containing child. 
 
int get_tab_pos(); 
//! Gets the edge at which the tabs are located. 
 
require gtk210; 
int get_tab_reorderable(GTK2.Widget child); 
//! Gets whether the tab can be reordered via drag and drop or not. 
 
int get_tab_detachable(GTK2.Widget child); 
//! Returns whether the tab contents can be detached. 
endrequire; 
 
mapping(string:int) query_tab_label_packing(GTK2.Widget page) 
//! Returns ([ "expand":expandp, "fill":fillp, "pack_type":type ]) 
{ 
  struct object *o; 
  gboolean expand=0, fill=0; 
  GtkPackType pack_type=0; 
  get_all_args(NULL,args,"%o",&o); 
  gtk_notebook_query_tab_label_packing(GTK_NOTEBOOK(THIS->obj), 
                                       GTK_WIDGET(get_gobject(o)), 
                                       &expand, 
                                       &fill, 
                                       &pack_type); 
  pgtk2_pop_n_elems(args); 
  ref_push_string(_STR("expand")); push_int(expand); 
  ref_push_string(_STR("fill")); push_int(fill); 
  ref_push_string(_STR("pack_type")); push_int(pack_type); 
  f_aggregate_mapping(6); 
}