CoreGTK 3.10.0 CoreGTK is an Objective-C language binding for the GTK+ widget toolkit

- Main Page
- Classes
- Files

- File List

All Classes Functions Variables
CGTKNotebook.m
1 /*
2 * CGTKNotebook.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2015 - Tyler Burton
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 * Modified by the CoreGTK Team, 2015. See the AUTHORS file for a
24 * list of people on the CoreGTK Team.
25 * See the ChangeLog files for a list of changes.
26 *
27 */
28
29 /*
30 * Objective-C imports
31 */
32 #import "CoreGTK/CGTKNotebook.h"
33
34 @implementation CGTKNotebook
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_notebook_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkNotebook*)NOTEBOOK
49 {
50 return GTK_NOTEBOOK([self GOBJECT]);
51 }
52
53 -(gint)appendPageWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel
54 {
55 return gtk_notebook_append_page(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET]);
56 }
57
58 -(gint)appendPageMenuWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel andMenuLabel:(CGTKWidget*) menuLabel
59 {
60 return gtk_notebook_append_page_menu(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET], [menuLabel WIDGET]);
61 }
62
63 -(CGTKWidget*)getActionWidget:(GtkPackType) packType
64 {
65 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_notebook_get_action_widget(GTK_NOTEBOOK([self GOBJECT]), packType)];
66 }
67
68 -(gint)getCurrentPage
69 {
70 return gtk_notebook_get_current_page(GTK_NOTEBOOK([self GOBJECT]));
71 }
72
73 -(NSString*)getGroupName
74 {
75 return [NSString stringWithUTF8String:gtk_notebook_get_group_name(GTK_NOTEBOOK([self GOBJECT]))];
76 }
77
78 -(CGTKWidget*)getMenuLabel:(CGTKWidget*) child
79 {
80 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_notebook_get_menu_label(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET])];
81 }
82
83 -(NSString*)getMenuLabelText:(CGTKWidget*) child
84 {
85 return [NSString stringWithUTF8String:gtk_notebook_get_menu_label_text(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET])];
86 }
87
88 -(gint)getNpages
89 {
90 return gtk_notebook_get_n_pages(GTK_NOTEBOOK([self GOBJECT]));
91 }
92
93 -(CGTKWidget*)getNthPage:(gint) pageNum
94 {
95 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_notebook_get_nth_page(GTK_NOTEBOOK([self GOBJECT]), pageNum)];
96 }
97
98 -(BOOL)getScrollable
99 {
100 return (gtk_notebook_get_scrollable(GTK_NOTEBOOK([self GOBJECT])) ? YES : NO);
101 }
102
103 -(BOOL)getShowBorder
104 {
105 return (gtk_notebook_get_show_border(GTK_NOTEBOOK([self GOBJECT])) ? YES : NO);
106 }
107
108 -(BOOL)getShowTabs
109 {
110 return (gtk_notebook_get_show_tabs(GTK_NOTEBOOK([self GOBJECT])) ? YES : NO);
111 }
112
113 -(BOOL)getTabDetachable:(CGTKWidget*) child
114 {
115 return (gtk_notebook_get_tab_detachable(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET]) ? YES : NO);
116 }
117
118 -(guint16)getTabHborder
119 {
120 return gtk_notebook_get_tab_hborder(GTK_NOTEBOOK([self GOBJECT]));
121 }
122
123 -(CGTKWidget*)getTabLabel:(CGTKWidget*) child
124 {
125 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_notebook_get_tab_label(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET])];
126 }
127
128 -(NSString*)getTabLabelText:(CGTKWidget*) child
129 {
130 return [NSString stringWithUTF8String:gtk_notebook_get_tab_label_text(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET])];
131 }
132
133 -(GtkPositionType)getTabPos
134 {
135 return gtk_notebook_get_tab_pos(GTK_NOTEBOOK([self GOBJECT]));
136 }
137
138 -(BOOL)getTabReorderable:(CGTKWidget*) child
139 {
140 return (gtk_notebook_get_tab_reorderable(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET]) ? YES : NO);
141 }
142
143 -(guint16)getTabVborder
144 {
145 return gtk_notebook_get_tab_vborder(GTK_NOTEBOOK([self GOBJECT]));
146 }
147
148 -(gint)insertPageWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel andPosition:(gint) position
149 {
150 return gtk_notebook_insert_page(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET], position);
151 }
152
153 -(gint)insertPageMenuWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel andMenuLabel:(CGTKWidget*) menuLabel andPosition:(gint) position
154 {
155 return gtk_notebook_insert_page_menu(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET], [menuLabel WIDGET], position);
156 }
157
158 -(void)nextPage
159 {
160 gtk_notebook_next_page(GTK_NOTEBOOK([self GOBJECT]));
161 }
162
163 -(gint)pageNum:(CGTKWidget*) child
164 {
165 return gtk_notebook_page_num(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET]);
166 }
167
168 -(void)popupDisable
169 {
170 gtk_notebook_popup_disable(GTK_NOTEBOOK([self GOBJECT]));
171 }
172
173 -(void)popupEnable
174 {
175 gtk_notebook_popup_enable(GTK_NOTEBOOK([self GOBJECT]));
176 }
177
178 -(gint)prependPageWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel
179 {
180 return gtk_notebook_prepend_page(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET]);
181 }
182
183 -(gint)prependPageMenuWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel andMenuLabel:(CGTKWidget*) menuLabel
184 {
185 return gtk_notebook_prepend_page_menu(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET], [menuLabel WIDGET]);
186 }
187
188 -(void)prevPage
189 {
190 gtk_notebook_prev_page(GTK_NOTEBOOK([self GOBJECT]));
191 }
192
193 -(void)removePage:(gint) pageNum
194 {
195 gtk_notebook_remove_page(GTK_NOTEBOOK([self GOBJECT]), pageNum);
196 }
197
198 -(void)reorderChildWithChild:(CGTKWidget*) child andPosition:(gint) position
199 {
200 gtk_notebook_reorder_child(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], position);
201 }
202
203 -(void)setActionWidgetWithWidget:(CGTKWidget*) widget andPackType:(GtkPackType) packType
204 {
205 gtk_notebook_set_action_widget(GTK_NOTEBOOK([self GOBJECT]), [widget WIDGET], packType);
206 }
207
208 -(void)setCurrentPage:(gint) pageNum
209 {
210 gtk_notebook_set_current_page(GTK_NOTEBOOK([self GOBJECT]), pageNum);
211 }
212
213 -(void)setGroupName:(NSString*) groupName
214 {
215 gtk_notebook_set_group_name(GTK_NOTEBOOK([self GOBJECT]), [groupName UTF8String]);
216 }
217
218 -(void)setMenuLabelWithChild:(CGTKWidget*) child andMenuLabel:(CGTKWidget*) menuLabel
219 {
220 gtk_notebook_set_menu_label(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [menuLabel WIDGET]);
221 }
222
223 -(void)setMenuLabelTextWithChild:(CGTKWidget*) child andMenuText:(NSString*) menuText
224 {
225 gtk_notebook_set_menu_label_text(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [menuText UTF8String]);
226 }
227
228 -(void)setScrollable:(BOOL) scrollable
229 {
230 gtk_notebook_set_scrollable(GTK_NOTEBOOK([self GOBJECT]), (scrollable ? TRUE : FALSE));
231 }
232
233 -(void)setShowBorder:(BOOL) showBorder
234 {
235 gtk_notebook_set_show_border(GTK_NOTEBOOK([self GOBJECT]), (showBorder ? TRUE : FALSE));
236 }
237
238 -(void)setShowTabs:(BOOL) showTabs
239 {
240 gtk_notebook_set_show_tabs(GTK_NOTEBOOK([self GOBJECT]), (showTabs ? TRUE : FALSE));
241 }
242
243 -(void)setTabDetachableWithChild:(CGTKWidget*) child andDetachable:(BOOL) detachable
244 {
245 gtk_notebook_set_tab_detachable(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], (detachable ? TRUE : FALSE));
246 }
247
248 -(void)setTabLabelWithChild:(CGTKWidget*) child andTabLabel:(CGTKWidget*) tabLabel
249 {
250 gtk_notebook_set_tab_label(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabLabel WIDGET]);
251 }
252
253 -(void)setTabLabelTextWithChild:(CGTKWidget*) child andTabText:(NSString*) tabText
254 {
255 gtk_notebook_set_tab_label_text(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], [tabText UTF8String]);
256 }
257
258 -(void)setTabPos:(GtkPositionType) pos
259 {
260 gtk_notebook_set_tab_pos(GTK_NOTEBOOK([self GOBJECT]), pos);
261 }
262
263 -(void)setTabReorderableWithChild:(CGTKWidget*) child andReorderable:(BOOL) reorderable
264 {
265 gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK([self GOBJECT]), [child WIDGET], (reorderable ? TRUE : FALSE));
266 }
267
268
269 @end
-[CGTKNotebook getShowTabs]
BOOL getShowTabs()
Definition: CGTKNotebook.m:108
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKNotebook getScrollable]
BOOL getScrollable()
Definition: CGTKNotebook.m:98
-[CGTKNotebook getTabVborder]
guint16 getTabVborder()
Definition: CGTKNotebook.m:143
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKNotebook nextPage]
void nextPage()
Definition: CGTKNotebook.m:158
-[CGTKNotebook NOTEBOOK]
GtkNotebook * NOTEBOOK()
Definition: CGTKNotebook.m:48
CGTKNotebook
Definition: CGTKNotebook.h:34
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKNotebook init]
id init()
Definition: CGTKNotebook.m:36
-[CGTKNotebook prevPage]
void prevPage()
Definition: CGTKNotebook.m:188
-[CGTKNotebook getTabPos]
GtkPositionType getTabPos()
Definition: CGTKNotebook.m:133
-[CGTKNotebook getTabHborder]
guint16 getTabHborder()
Definition: CGTKNotebook.m:118
-[CGTKNotebook popupDisable]
void popupDisable()
Definition: CGTKNotebook.m:168
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKNotebook getShowBorder]
BOOL getShowBorder()
Definition: CGTKNotebook.m:103
-[CGTKNotebook getGroupName]
NSString * getGroupName()
Definition: CGTKNotebook.m:73
-[CGTKNotebook popupEnable]
void popupEnable()
Definition: CGTKNotebook.m:173
-[CGTKNotebook getNpages]
gint getNpages()
Definition: CGTKNotebook.m:88
-[CGTKNotebook getCurrentPage]
gint getCurrentPage()
Definition: CGTKNotebook.m:68