File: | tests/testbaseline.c |
Warning: | line 138, column 3 Value stored to 'grid_hbox' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* |
2 | * Copyright (C) 2006 Nokia Corporation. |
3 | * Author: Xan Lopez <xan.lopez@nokia.com> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Lesser General Public License |
7 | * version 2.1 as published by the Free Software Foundation. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, but |
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | */ |
18 | |
19 | #include <ctk/ctk.h> |
20 | |
21 | static char *baseline_pos_str[] = { |
22 | "BASELINE_POSITION_TOP", |
23 | "BASELINE_POSITION_CENTER", |
24 | "BASELINE_POSITION_BOTTOM" |
25 | }; |
26 | |
27 | static void |
28 | baseline_row_value_changed (CtkSpinButton *spin_button, |
29 | CtkGrid *grid) |
30 | { |
31 | gint row = ctk_spin_button_get_value_as_int (spin_button); |
32 | |
33 | ctk_grid_set_baseline_row (grid, row); |
34 | } |
35 | |
36 | static void |
37 | homogeneous_changed (CtkToggleButton *toggle_button, |
38 | CtkGrid *grid) |
39 | { |
40 | ctk_grid_set_row_homogeneous (grid, ctk_toggle_button_get_active (toggle_button)); |
41 | } |
42 | |
43 | static void |
44 | baseline_position_changed (CtkComboBox *combo, |
45 | CtkBox *hbox) |
46 | { |
47 | int i = ctk_combo_box_get_active (combo); |
48 | |
49 | ctk_box_set_baseline_position (hbox, i); |
50 | } |
51 | |
52 | static void |
53 | image_size_value_changed (CtkSpinButton *spin_button, |
54 | CtkImage *image) |
55 | { |
56 | gint size = ctk_spin_button_get_value_as_int (spin_button); |
57 | |
58 | ctk_image_set_pixel_size (CTK_IMAGE (image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((image)), ((ctk_image_get_type ())))))), size); |
59 | } |
60 | |
61 | static void |
62 | set_font_size (CtkWidget *widget, gint size) |
63 | { |
64 | const gchar *class[3] = { "small-font", "medium-font", "large-font" }; |
65 | |
66 | ctk_style_context_add_class (ctk_widget_get_style_context (widget), class[size]); |
67 | } |
68 | |
69 | int |
70 | main (int argc, |
71 | char **argv) |
72 | { |
73 | CtkWidget *window, *label, *entry, *button, *grid, *notebook; |
74 | CtkWidget *vbox, *hbox, *grid_hbox, *spin, *spin2, *toggle, *combo, *image; |
75 | CtkAdjustment *adjustment; |
76 | int i, j; |
77 | CtkCssProvider *provider; |
78 | |
79 | ctk_init (&argc, &argv); |
80 | |
81 | provider = ctk_css_provider_new (); |
82 | ctk_css_provider_load_from_data (provider, |
83 | ".small-font { font-size: 5px; }" |
84 | ".medium-font { font-size: 10px; }" |
85 | ".large-font { font-size: 15px; }", -1, NULL((void*)0)); |
86 | ctk_style_context_add_provider_for_screen (cdk_screen_get_default (), |
87 | CTK_STYLE_PROVIDER (provider)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((provider)), ((ctk_style_provider_get_type ( ))))))), |
88 | CTK_STYLE_PROVIDER_PRIORITY_APPLICATION600); |
89 | g_object_unref (provider); |
90 | window = ctk_window_new (CTK_WINDOW_TOPLEVEL); |
91 | g_signal_connect (G_OBJECT (window), "delete-event", G_CALLBACK (ctk_main_quit), NULL)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((window)), (((GType) ((20) << (2))) )))))), ("delete-event"), (((GCallback) (ctk_main_quit))), (( (void*)0)), ((void*)0), (GConnectFlags) 0); |
92 | |
93 | notebook = ctk_notebook_new (); |
94 | ctk_container_add (CTK_CONTAINER (window)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((window)), ((ctk_container_get_type ())))))), notebook); |
95 | |
96 | vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 0); |
97 | ctk_notebook_append_page (CTK_NOTEBOOK (notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((notebook)), ((ctk_notebook_get_type ())))))), |
98 | vbox, ctk_label_new ("hboxes")); |
99 | |
100 | for (j = 0; j < 2; j++) |
101 | { |
102 | char *aligns_names[] = { "FILL", "BASELINE" }; |
103 | CtkAlign aligns[] = { CTK_ALIGN_FILL, CTK_ALIGN_BASELINE}; |
104 | |
105 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
106 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, FALSE(0), FALSE(0), 5); |
107 | |
108 | label = ctk_label_new (aligns_names[j]); |
109 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), label); |
110 | |
111 | for (i = 0; i < 3; i++) { |
112 | label = ctk_label_new ("│XYyj,Ö..."); |
113 | |
114 | set_font_size (label, i); |
115 | |
116 | ctk_widget_set_valign (label, aligns[j]); |
117 | |
118 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), label); |
119 | } |
120 | |
121 | for (i = 0; i < 3; i++) { |
122 | entry = ctk_entry_new (); |
123 | ctk_entry_set_text (CTK_ENTRY (entry)((((CtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((entry)), ((ctk_entry_get_type ())))))), "│XYyj,Ö..."); |
124 | |
125 | set_font_size (entry, i); |
126 | |
127 | ctk_widget_set_valign (entry, aligns[j]); |
128 | |
129 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), entry); |
130 | } |
131 | |
132 | spin = ctk_spin_button_new (NULL((void*)0), 0, 1); |
133 | ctk_orientable_set_orientation (CTK_ORIENTABLE (spin)((((CtkOrientable*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((spin)), ((ctk_orientable_get_type ())))))), CTK_ORIENTATION_VERTICAL); |
134 | ctk_widget_set_valign (spin, aligns[j]); |
135 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), spin); |
136 | } |
137 | |
138 | grid_hbox = hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
Value stored to 'grid_hbox' is never read | |
139 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, TRUE(!(0)), TRUE(!(0)), 5); |
140 | |
141 | combo = ctk_combo_box_text_new (); |
142 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[0]); |
143 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[1]); |
144 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[2]); |
145 | ctk_combo_box_set_active (CTK_COMBO_BOX (combo)((((CtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_get_type ())))))), 1); |
146 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), combo); |
147 | |
148 | for (j = 0; j < 2; j++) |
149 | { |
150 | CtkWidget *ebox; |
151 | |
152 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
153 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, TRUE(!(0)), TRUE(!(0)), 5); |
154 | |
155 | g_signal_connect (G_OBJECT (combo), "changed",g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((combo)), (((GType) ((20) << (2)))) ))))), ("changed"), (((GCallback) (baseline_position_changed) )), (hbox), ((void*)0), (GConnectFlags) 0) |
156 | G_CALLBACK (baseline_position_changed), hbox)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((combo)), (((GType) ((20) << (2)))) ))))), ("changed"), (((GCallback) (baseline_position_changed) )), (hbox), ((void*)0), (GConnectFlags) 0); |
157 | |
158 | if (j == 0) |
159 | label = ctk_label_new ("Baseline:"); |
160 | else |
161 | label = ctk_label_new ("Normal:"); |
162 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), label); |
163 | |
164 | for (i = 0; i < 3; i++) |
165 | { |
166 | button = ctk_button_new_with_label ("│Xyj,Ö"); |
167 | |
168 | set_font_size (button, i); |
169 | |
170 | if (j == 0) |
171 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
172 | |
173 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
174 | } |
175 | |
176 | for (i = 0; i < 3; i++) |
177 | { |
178 | button = ctk_button_new_with_label ("│Xyj,Ö"); |
179 | |
180 | ctk_button_set_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), |
181 | ctk_image_new_from_icon_name ("face-sad", CTK_ICON_SIZE_BUTTON)); |
182 | ctk_button_set_always_show_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), TRUE(!(0))); |
183 | |
184 | set_font_size (button, i); |
185 | |
186 | if (j == 0) |
187 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
188 | |
189 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
190 | } |
191 | |
192 | ebox = ctk_event_box_new (); |
193 | if (j == 0) |
194 | ctk_widget_set_valign (ebox, CTK_ALIGN_BASELINE); |
195 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), ebox); |
196 | |
197 | image = ctk_image_new_from_icon_name ("face-sad", CTK_ICON_SIZE_BUTTON); |
198 | ctk_image_set_pixel_size (CTK_IMAGE (image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((image)), ((ctk_image_get_type ())))))), 34); |
199 | if (j == 0) |
200 | ctk_widget_set_valign (image, CTK_ALIGN_BASELINE); |
201 | ctk_container_add (CTK_CONTAINER (ebox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((ebox)), ((ctk_container_get_type ())))))), image); |
202 | |
203 | button = ctk_toggle_button_new_with_label ("│Xyj,Ö"); |
204 | if (j == 0) |
205 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
206 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
207 | |
208 | button = ctk_toggle_button_new_with_label ("│Xyj,Ö"); |
209 | ctk_toggle_button_set_mode (CTK_TOGGLE_BUTTON (button)((((CtkToggleButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_toggle_button_get_type ())))))), TRUE(!(0))); |
210 | if (j == 0) |
211 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
212 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
213 | |
214 | button = ctk_check_button_new_with_label ("│Xyj,Ö"); |
215 | if (j == 0) |
216 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
217 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
218 | |
219 | button = ctk_radio_button_new_with_label (NULL((void*)0), "│Xyj,Ö"); |
220 | if (j == 0) |
221 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
222 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
223 | } |
224 | |
225 | |
226 | vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 0); |
227 | ctk_notebook_append_page (CTK_NOTEBOOK (notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((notebook)), ((ctk_notebook_get_type ())))))), |
228 | vbox, ctk_label_new ("grid")); |
229 | |
230 | grid_hbox = hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
231 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, TRUE(!(0)), TRUE(!(0)), 5); |
232 | |
233 | label = ctk_label_new ("Align me:"); |
234 | ctk_widget_set_valign (label, CTK_ALIGN_BASELINE); |
235 | |
236 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), label); |
237 | |
238 | grid = ctk_grid_new (); |
239 | ctk_widget_set_valign (grid, CTK_ALIGN_BASELINE); |
240 | ctk_grid_set_column_spacing (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), 8); |
241 | ctk_grid_set_row_spacing (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), 8); |
242 | |
243 | for (j = 0; j < 4; j++) |
244 | { |
245 | char *labels[] = { "Normal:", "Baseline (top):", "Baseline (center):", "Baseline (bottom):"}; |
246 | label = ctk_label_new (labels[j]); |
247 | |
248 | ctk_grid_attach (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), |
249 | label, |
250 | 0, j, |
251 | 1, 1); |
252 | ctk_widget_set_vexpand (label, TRUE(!(0))); |
253 | |
254 | if (j != 0) |
255 | ctk_grid_set_row_baseline_position (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), |
256 | j, (CtkBaselinePosition)(j-1)); |
257 | |
258 | for (i = 0; i < 3; i++) |
259 | { |
260 | label = ctk_label_new ("Xyjg,Ö."); |
261 | |
262 | set_font_size (label, i); |
263 | |
264 | if (j != 0) |
265 | ctk_widget_set_valign (label, CTK_ALIGN_BASELINE); |
266 | |
267 | ctk_grid_attach (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), |
268 | label, |
269 | i+1, j, |
270 | 1, 1); |
271 | } |
272 | |
273 | for (i = 0; i < 3; i++) |
274 | { |
275 | button = ctk_button_new_with_label ("│Xyj,Ö"); |
276 | |
277 | ctk_button_set_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), |
278 | ctk_image_new_from_icon_name ("face-sad", CTK_ICON_SIZE_BUTTON)); |
279 | ctk_button_set_always_show_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), TRUE(!(0))); |
280 | |
281 | set_font_size (button, i); |
282 | |
283 | if (j != 0) |
284 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
285 | |
286 | ctk_grid_attach (CTK_GRID (grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((grid)), ((ctk_grid_get_type ())))))), |
287 | button, |
288 | i+4, j, |
289 | 1, 1); |
290 | } |
291 | |
292 | } |
293 | |
294 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), grid); |
295 | |
296 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
297 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, FALSE(0), FALSE(0), 5); |
298 | |
299 | adjustment = ctk_adjustment_new (0.0, -1.0, 5.0, 1.0, 1.0, 0.0); |
300 | spin = ctk_spin_button_new (adjustment, 1.0, 0); |
301 | g_signal_connect (spin, "value-changed", (GCallback)baseline_row_value_changed, grid)g_signal_connect_data ((spin), ("value-changed"), ((GCallback )baseline_row_value_changed), (grid), ((void*)0), (GConnectFlags ) 0); |
302 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), spin); |
303 | |
304 | toggle = ctk_toggle_button_new_with_label ("Homogeneous"); |
305 | g_signal_connect (toggle, "toggled", (GCallback)homogeneous_changed, grid)g_signal_connect_data ((toggle), ("toggled"), ((GCallback)homogeneous_changed ), (grid), ((void*)0), (GConnectFlags) 0); |
306 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), toggle); |
307 | |
308 | combo = ctk_combo_box_text_new (); |
309 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[0]); |
310 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[1]); |
311 | ctk_combo_box_text_append_text (CTK_COMBO_BOX_TEXT (combo)((((CtkComboBoxText*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_text_get_type ())))))), baseline_pos_str[2]); |
312 | ctk_combo_box_set_active (CTK_COMBO_BOX (combo)((((CtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((combo)), ((ctk_combo_box_get_type ())))))), 1); |
313 | g_signal_connect (G_OBJECT (combo), "changed",g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((combo)), (((GType) ((20) << (2)))) ))))), ("changed"), (((GCallback) (baseline_position_changed) )), (grid_hbox), ((void*)0), (GConnectFlags) 0) |
314 | G_CALLBACK (baseline_position_changed), grid_hbox)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((combo)), (((GType) ((20) << (2)))) ))))), ("changed"), (((GCallback) (baseline_position_changed) )), (grid_hbox), ((void*)0), (GConnectFlags) 0); |
315 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), combo); |
316 | |
317 | vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 0); |
318 | ctk_notebook_append_page (CTK_NOTEBOOK (notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((notebook)), ((ctk_notebook_get_type ())))))), |
319 | vbox, ctk_label_new ("button box")); |
320 | |
321 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 10); |
322 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, FALSE(0), FALSE(0), 5); |
323 | |
324 | adjustment = ctk_adjustment_new (34.0, 1.0, 64.0, 1.0, 1.0, 0.0); |
325 | spin = ctk_spin_button_new (adjustment, 1.0, 0); |
326 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), spin); |
327 | |
328 | adjustment = ctk_adjustment_new (16.0, 1.0, 64.0, 1.0, 1.0, 0.0); |
329 | spin2 = ctk_spin_button_new (adjustment, 1.0, 0); |
330 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), spin2); |
331 | |
332 | for (j = 0; j < 3; j++) |
333 | { |
334 | hbox = ctk_button_box_new (CTK_ORIENTATION_HORIZONTAL); |
335 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), hbox, TRUE(!(0)), TRUE(!(0)), 5); |
336 | |
337 | ctk_box_set_baseline_position (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), j); |
338 | |
339 | label = ctk_label_new (baseline_pos_str[j]); |
340 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), label); |
341 | ctk_widget_set_vexpand (label, TRUE(!(0))); |
342 | |
343 | image = ctk_image_new_from_icon_name ("face-sad", CTK_ICON_SIZE_BUTTON); |
344 | ctk_image_set_pixel_size (CTK_IMAGE (image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((image)), ((ctk_image_get_type ())))))), 34); |
345 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), image); |
346 | |
347 | g_signal_connect (spin, "value-changed", (GCallback)image_size_value_changed, image)g_signal_connect_data ((spin), ("value-changed"), ((GCallback )image_size_value_changed), (image), ((void*)0), (GConnectFlags ) 0); |
348 | |
349 | for (i = 0; i < 3; i++) |
350 | { |
351 | button = ctk_button_new_with_label ("│Xyj,Ö"); |
352 | |
353 | set_font_size (button, i); |
354 | |
355 | if (i != 0) |
356 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
357 | |
358 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
359 | } |
360 | |
361 | for (i = 0; i < 3; i++) |
362 | { |
363 | button = ctk_button_new_with_label ("│Xyj,Ö"); |
364 | |
365 | image = ctk_image_new_from_icon_name ("face-sad", CTK_ICON_SIZE_BUTTON); |
366 | ctk_image_set_pixel_size (CTK_IMAGE (image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((image)), ((ctk_image_get_type ())))))), 16); |
367 | ctk_button_set_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), image); |
368 | if (i == 0) |
369 | g_signal_connect (spin2, "value-changed", (GCallback)image_size_value_changed, image)g_signal_connect_data ((spin2), ("value-changed"), ((GCallback )image_size_value_changed), (image), ((void*)0), (GConnectFlags ) 0); |
370 | ctk_button_set_always_show_image (CTK_BUTTON (button)((((CtkButton*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((button)), ((ctk_button_get_type ())))))), TRUE(!(0))); |
371 | |
372 | set_font_size (button, i); |
373 | |
374 | ctk_widget_set_valign (button, CTK_ALIGN_BASELINE); |
375 | |
376 | ctk_container_add (CTK_CONTAINER (hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_container_get_type ())))))), button); |
377 | } |
378 | } |
379 | |
380 | ctk_widget_show_all (window); |
381 | |
382 | ctk_main (); |
383 | |
384 | return 0; |
385 | } |