File: | tests/testfilechooserbutton.c |
Warning: | line 242, column 5 This statement is never executed |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 2 -*- */ |
2 | |
3 | /* CTK+: ctkfilechooserbutton.c |
4 | * |
5 | * Copyright (c) 2004 James M. Cape <jcape@ignore-your.tv> |
6 | * |
7 | * This library is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU Library General Public |
9 | * License as published by the Free Software Foundation; either |
10 | * version 2 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 | * Library General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU Library General Public |
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
19 | */ |
20 | |
21 | #include "config.h" |
22 | |
23 | #ifdef HAVE_UNISTD_H1 |
24 | #include <unistd.h> |
25 | #endif |
26 | |
27 | #include <sys/types.h> |
28 | #include <sys/stat.h> |
29 | |
30 | #include <string.h> |
31 | |
32 | #include <ctk/ctk.h> |
33 | |
34 | static gchar *backend = "ctk+"; |
35 | static gboolean rtl = FALSE(0); |
36 | static GOptionEntry entries[] = { |
37 | { "backend", 'b', 0, G_OPTION_ARG_STRING, &backend, "The filesystem backend to use.", "ctk+" }, |
38 | { "right-to-left", 'r', 0, G_OPTION_ARG_NONE, &rtl, "Force right-to-left layout.", NULL((void*)0) }, |
39 | { NULL((void*)0) } |
40 | }; |
41 | |
42 | static gchar *ctk_src_dir = NULL((void*)0); |
43 | |
44 | static gboolean |
45 | delete_event_cb (CtkWidget *editor, |
46 | gint response G_GNUC_UNUSED__attribute__ ((__unused__)), |
47 | gpointer user_data G_GNUC_UNUSED__attribute__ ((__unused__))) |
48 | { |
49 | ctk_widget_hide (editor); |
50 | |
51 | return TRUE(!(0)); |
52 | } |
53 | |
54 | |
55 | static void |
56 | print_selected_path_clicked_cb (CtkWidget *button G_GNUC_UNUSED__attribute__ ((__unused__)), |
57 | gpointer user_data) |
58 | { |
59 | gchar *folder, *filename; |
60 | |
61 | folder = ctk_file_chooser_get_current_folder (user_data); |
62 | filename = ctk_file_chooser_get_filename (user_data); |
63 | g_message ("Currently Selected:\n\tFolder: `%s'\n\tFilename: `%s'\nDone.\n", |
64 | folder, filename); |
65 | g_free (folder); |
66 | g_free (filename); |
67 | } |
68 | |
69 | static void |
70 | add_pwds_parent_as_shortcut_clicked_cb (CtkWidget *button G_GNUC_UNUSED__attribute__ ((__unused__)), |
71 | gpointer user_data) |
72 | { |
73 | GError *err = NULL((void*)0); |
74 | |
75 | if (!ctk_file_chooser_add_shortcut_folder (user_data, ctk_src_dir, &err)) |
76 | { |
77 | g_message ("Couldn't add `%s' as shortcut folder: %s", ctk_src_dir, |
78 | err->message); |
79 | g_error_free (err); |
80 | } |
81 | else |
82 | { |
83 | g_message ("Added `%s' as shortcut folder.", ctk_src_dir); |
84 | } |
85 | } |
86 | |
87 | static void |
88 | del_pwds_parent_as_shortcut_clicked_cb (CtkWidget *button G_GNUC_UNUSED__attribute__ ((__unused__)), |
89 | gpointer user_data) |
90 | { |
91 | GError *err = NULL((void*)0); |
92 | |
93 | if (!ctk_file_chooser_remove_shortcut_folder (user_data, ctk_src_dir, &err)) |
94 | { |
95 | g_message ("Couldn't remove `%s' as shortcut folder: %s", ctk_src_dir, |
96 | err->message); |
97 | g_error_free (err); |
98 | } |
99 | else |
100 | { |
101 | g_message ("Removed `%s' as shortcut folder.", ctk_src_dir); |
102 | } |
103 | } |
104 | |
105 | static void |
106 | unselect_all_clicked_cb (CtkWidget *button G_GNUC_UNUSED__attribute__ ((__unused__)), |
107 | gpointer user_data) |
108 | { |
109 | ctk_file_chooser_unselect_all (user_data); |
110 | } |
111 | |
112 | static void |
113 | tests_button_clicked_cb (CtkButton *real_button G_GNUC_UNUSED__attribute__ ((__unused__)), |
114 | gpointer user_data) |
115 | { |
116 | CtkWidget *tests; |
117 | |
118 | tests = g_object_get_data (user_data, "tests-dialog"); |
119 | |
120 | if (tests == NULL((void*)0)) |
121 | { |
122 | CtkWidget *box, *button; |
123 | |
124 | tests = ctk_window_new (CTK_WINDOW_TOPLEVEL); |
125 | ctk_window_set_title (CTK_WINDOW (tests)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((tests)), ((ctk_window_get_type ())))))), |
126 | "Tests - TestFileChooserButton"); |
127 | ctk_container_set_border_width (CTK_CONTAINER (tests)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((tests)), ((ctk_container_get_type ())))))), 12); |
128 | ctk_window_set_transient_for (CTK_WINDOW (tests)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((tests)), ((ctk_window_get_type ())))))), |
129 | CTK_WINDOW (ctk_widget_get_toplevel (user_data))((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((ctk_widget_get_toplevel (user_data))), ((ctk_window_get_type ()))))))); |
130 | |
131 | box = ctk_box_new (CTK_ORIENTATION_VERTICAL, 0); |
132 | ctk_container_add (CTK_CONTAINER (tests)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((tests)), ((ctk_container_get_type ())))))), box); |
133 | ctk_widget_show (box); |
134 | |
135 | button = ctk_button_new_with_label ("Print Selected Path"); |
136 | g_signal_connect (button, "clicked",g_signal_connect_data ((button), ("clicked"), (((GCallback) ( print_selected_path_clicked_cb))), (user_data), ((void*)0), ( GConnectFlags) 0) |
137 | G_CALLBACK (print_selected_path_clicked_cb), user_data)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( print_selected_path_clicked_cb))), (user_data), ((void*)0), ( GConnectFlags) 0); |
138 | ctk_box_pack_start (CTK_BOX (box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((box)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
139 | ctk_widget_show (button); |
140 | |
141 | button = ctk_button_new_with_label ("Add $PWD's Parent as Shortcut"); |
142 | g_signal_connect (button, "clicked",g_signal_connect_data ((button), ("clicked"), (((GCallback) ( add_pwds_parent_as_shortcut_clicked_cb))), (user_data), ((void *)0), (GConnectFlags) 0) |
143 | G_CALLBACK (add_pwds_parent_as_shortcut_clicked_cb), user_data)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( add_pwds_parent_as_shortcut_clicked_cb))), (user_data), ((void *)0), (GConnectFlags) 0); |
144 | ctk_box_pack_start (CTK_BOX (box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((box)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
145 | ctk_widget_show (button); |
146 | |
147 | button = ctk_button_new_with_label ("Remove $PWD's Parent as Shortcut"); |
148 | g_signal_connect (button, "clicked",g_signal_connect_data ((button), ("clicked"), (((GCallback) ( del_pwds_parent_as_shortcut_clicked_cb))), (user_data), ((void *)0), (GConnectFlags) 0) |
149 | G_CALLBACK (del_pwds_parent_as_shortcut_clicked_cb), user_data)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( del_pwds_parent_as_shortcut_clicked_cb))), (user_data), ((void *)0), (GConnectFlags) 0); |
150 | ctk_box_pack_start (CTK_BOX (box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((box)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
151 | ctk_widget_show (button); |
152 | |
153 | button = ctk_button_new_with_label ("Unselect all"); |
154 | g_signal_connect (button, "clicked",g_signal_connect_data ((button), ("clicked"), (((GCallback) ( unselect_all_clicked_cb))), (user_data), ((void*)0), (GConnectFlags ) 0) |
155 | G_CALLBACK (unselect_all_clicked_cb), user_data)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( unselect_all_clicked_cb))), (user_data), ((void*)0), (GConnectFlags ) 0); |
156 | ctk_box_pack_start (CTK_BOX (box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((box)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
157 | ctk_widget_show (button); |
158 | |
159 | g_signal_connect (tests, "delete-event", G_CALLBACK (delete_event_cb), NULL)g_signal_connect_data ((tests), ("delete-event"), (((GCallback ) (delete_event_cb))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
160 | g_object_set_data (user_data, "tests-dialog", tests); |
161 | } |
162 | |
163 | ctk_window_present (CTK_WINDOW (tests)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((tests)), ((ctk_window_get_type ()))))))); |
164 | } |
165 | |
166 | static void |
167 | chooser_current_folder_changed_cb (CtkFileChooser *chooser, |
168 | gpointer user_data G_GNUC_UNUSED__attribute__ ((__unused__))) |
169 | { |
170 | gchar *folder, *filename; |
171 | |
172 | folder = ctk_file_chooser_get_current_folder_uri (chooser); |
173 | filename = ctk_file_chooser_get_uri (chooser); |
174 | g_message ("%s::current-folder-changed\n\tFolder: `%s'\n\tFilename: `%s'\nDone.\n", |
175 | G_OBJECT_TYPE_NAME (chooser)(g_type_name ((((((GTypeClass*) (((GTypeInstance*) (chooser)) ->g_class))->g_type))))), folder, filename); |
176 | g_free (folder); |
177 | g_free (filename); |
178 | } |
179 | |
180 | static void |
181 | chooser_selection_changed_cb (CtkFileChooser *chooser, |
182 | gpointer user_data G_GNUC_UNUSED__attribute__ ((__unused__))) |
183 | { |
184 | gchar *filename; |
185 | |
186 | filename = ctk_file_chooser_get_uri (chooser); |
187 | g_message ("%s::selection-changed\n\tSelection:`%s'\nDone.\n", |
188 | G_OBJECT_TYPE_NAME (chooser)(g_type_name ((((((GTypeClass*) (((GTypeInstance*) (chooser)) ->g_class))->g_type))))), filename); |
189 | g_free (filename); |
190 | } |
191 | |
192 | static void |
193 | chooser_file_activated_cb (CtkFileChooser *chooser, |
194 | gpointer user_data G_GNUC_UNUSED__attribute__ ((__unused__))) |
195 | { |
196 | gchar *folder, *filename; |
197 | |
198 | folder = ctk_file_chooser_get_current_folder_uri (chooser); |
199 | filename = ctk_file_chooser_get_uri (chooser); |
200 | g_message ("%s::file-activated\n\tFolder: `%s'\n\tFilename: `%s'\nDone.\n", |
201 | G_OBJECT_TYPE_NAME (chooser)(g_type_name ((((((GTypeClass*) (((GTypeInstance*) (chooser)) ->g_class))->g_type))))), folder, filename); |
202 | g_free (folder); |
203 | g_free (filename); |
204 | } |
205 | |
206 | static void |
207 | chooser_update_preview_cb (CtkFileChooser *chooser, |
208 | gpointer user_data G_GNUC_UNUSED__attribute__ ((__unused__))) |
209 | { |
210 | gchar *filename; |
211 | |
212 | filename = ctk_file_chooser_get_preview_uri (chooser); |
213 | if (filename != NULL((void*)0)) |
214 | { |
215 | g_message ("%s::update-preview\n\tPreview Filename: `%s'\nDone.\n", |
216 | G_OBJECT_TYPE_NAME (chooser)(g_type_name ((((((GTypeClass*) (((GTypeInstance*) (chooser)) ->g_class))->g_type))))), filename); |
217 | g_free (filename); |
218 | } |
219 | } |
220 | |
221 | |
222 | int |
223 | main (int argc, |
224 | char *argv[]) |
225 | { |
226 | CtkWidget *win, *vbox, *frame, *group_box; |
227 | CtkWidget *hbox, *label, *chooser, *button; |
228 | CtkSizeGroup *label_group; |
229 | GOptionContext *context; |
230 | gchar *cwd; |
231 | |
232 | context = g_option_context_new ("- test CtkFileChooserButton widget"); |
233 | g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE"ctk30"); |
234 | g_option_context_add_group (context, ctk_get_option_group (TRUE(!(0)))); |
235 | g_option_context_parse (context, &argc, &argv, NULL((void*)0)); |
236 | g_option_context_free (context); |
237 | |
238 | ctk_init (&argc, &argv); |
239 | |
240 | /* to test rtl layout, use "--right-to-left" */ |
241 | if (rtl) |
242 | ctk_widget_set_default_direction (CTK_TEXT_DIR_RTL); |
This statement is never executed | |
243 | |
244 | cwd = g_get_current_dir(); |
245 | ctk_src_dir = g_path_get_dirname (cwd); |
246 | g_free (cwd); |
247 | |
248 | win = ctk_dialog_new_with_buttons ("TestFileChooserButton", NULL((void*)0), 0, |
249 | "_Quit", CTK_RESPONSE_CLOSE, NULL((void*)0)); |
250 | g_signal_connect (win, "response", G_CALLBACK (ctk_main_quit), NULL)g_signal_connect_data ((win), ("response"), (((GCallback) (ctk_main_quit ))), (((void*)0)), ((void*)0), (GConnectFlags) 0); |
251 | |
252 | vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 18); |
253 | g_object_set (vbox, "margin", 6, NULL((void*)0)); |
254 | ctk_container_add (CTK_CONTAINER (ctk_dialog_get_content_area (CTK_DIALOG (win)))((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((ctk_dialog_get_content_area (((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((win)), ((ctk_dialog_get_type ()))))))))) , ((ctk_container_get_type ())))))), vbox); |
255 | |
256 | frame = ctk_frame_new ("<b>CtkFileChooserButton</b>"); |
257 | ctk_frame_set_shadow_type (CTK_FRAME (frame)((((CtkFrame*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((frame)), ((ctk_frame_get_type ())))))), CTK_SHADOW_NONE); |
258 | ctk_label_set_use_markup (CTK_LABEL (ctk_frame_get_label_widget (CTK_FRAME (frame)))((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((ctk_frame_get_label_widget (((((CtkFrame*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((frame)), ((ctk_frame_get_type ())))))))) ), ((ctk_label_get_type ())))))), TRUE(!(0))); |
259 | ctk_box_pack_start (CTK_BOX (vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((vbox)), ((ctk_box_get_type ())))))), frame, FALSE(0), FALSE(0), 0); |
260 | |
261 | ctk_widget_set_halign (frame, CTK_ALIGN_FILL); |
262 | ctk_widget_set_valign (frame, CTK_ALIGN_FILL); |
263 | g_object_set (frame, "margin-top", 6, "margin-start", 12, NULL((void*)0)); |
264 | |
265 | label_group = ctk_size_group_new (CTK_SIZE_GROUP_HORIZONTAL); |
266 | |
267 | group_box = ctk_box_new (CTK_ORIENTATION_VERTICAL, 6); |
268 | ctk_container_add (CTK_CONTAINER (frame)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((frame)), ((ctk_container_get_type ())))))), group_box); |
269 | |
270 | /* OPEN */ |
271 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 12); |
272 | ctk_box_pack_start (CTK_BOX (group_box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((group_box)), ((ctk_box_get_type ())))))), hbox, FALSE(0), FALSE(0), 0); |
273 | |
274 | label = ctk_label_new_with_mnemonic ("_Open:"); |
275 | ctk_size_group_add_widget (CTK_SIZE_GROUP (label_group)((((CtkSizeGroup*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label_group)), ((ctk_size_group_get_type ())))))), label); |
276 | G_GNUC_BEGIN_IGNORE_DEPRECATIONSclang diagnostic push
clang diagnostic ignored "-Wdeprecated-declarations" |
277 | ctk_misc_set_alignment (CTK_MISC (label)((((CtkMisc*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label)), ((ctk_misc_get_type ())))))), 0.0, 0.5); |
278 | G_GNUC_END_IGNORE_DEPRECATIONSclang diagnostic pop |
279 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), label, FALSE(0), FALSE(0), 0); |
280 | |
281 | chooser = ctk_file_chooser_button_new ("Select A File - testfilechooserbutton", |
282 | CTK_FILE_CHOOSER_ACTION_OPEN); |
283 | ctk_file_chooser_add_shortcut_folder (CTK_FILE_CHOOSER (chooser)((((CtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((chooser)), ((ctk_file_chooser_get_type ())))))), ctk_src_dir, NULL((void*)0)); |
284 | ctk_file_chooser_remove_shortcut_folder (CTK_FILE_CHOOSER (chooser)((((CtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((chooser)), ((ctk_file_chooser_get_type ())))))), ctk_src_dir, NULL((void*)0)); |
285 | ctk_label_set_mnemonic_widget (CTK_LABEL (label)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label)), ((ctk_label_get_type ())))))), chooser); |
286 | g_signal_connect (chooser, "current-folder-changed",g_signal_connect_data ((chooser), ("current-folder-changed"), (((GCallback) (chooser_current_folder_changed_cb))), (((void *)0)), ((void*)0), (GConnectFlags) 0) |
287 | G_CALLBACK (chooser_current_folder_changed_cb), NULL)g_signal_connect_data ((chooser), ("current-folder-changed"), (((GCallback) (chooser_current_folder_changed_cb))), (((void *)0)), ((void*)0), (GConnectFlags) 0); |
288 | g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL)g_signal_connect_data ((chooser), ("selection-changed"), (((GCallback ) (chooser_selection_changed_cb))), (((void*)0)), ((void*)0), (GConnectFlags) 0); |
289 | g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL)g_signal_connect_data ((chooser), ("file-activated"), (((GCallback ) (chooser_file_activated_cb))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
290 | g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL)g_signal_connect_data ((chooser), ("update-preview"), (((GCallback ) (chooser_update_preview_cb))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
291 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), chooser, TRUE(!(0)), TRUE(!(0)), 0); |
292 | |
293 | button = ctk_button_new_with_label ("Tests"); |
294 | g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( tests_button_clicked_cb))), (chooser), ((void*)0), (GConnectFlags ) 0); |
295 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
296 | |
297 | /* SELECT_FOLDER */ |
298 | hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 12); |
299 | ctk_box_pack_start (CTK_BOX (group_box)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((group_box)), ((ctk_box_get_type ())))))), hbox, FALSE(0), FALSE(0), 0); |
300 | |
301 | label = ctk_label_new_with_mnemonic ("Select _Folder:"); |
302 | ctk_size_group_add_widget (CTK_SIZE_GROUP (label_group)((((CtkSizeGroup*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label_group)), ((ctk_size_group_get_type ())))))), label); |
303 | G_GNUC_BEGIN_IGNORE_DEPRECATIONSclang diagnostic push
clang diagnostic ignored "-Wdeprecated-declarations" |
304 | ctk_misc_set_alignment (CTK_MISC (label)((((CtkMisc*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label)), ((ctk_misc_get_type ())))))), 0.0, 0.5); |
305 | G_GNUC_END_IGNORE_DEPRECATIONSclang diagnostic pop |
306 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), label, FALSE(0), FALSE(0), 0); |
307 | |
308 | chooser = ctk_file_chooser_button_new ("Select A Folder - testfilechooserbutton", |
309 | CTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); |
310 | ctk_file_chooser_add_shortcut_folder (CTK_FILE_CHOOSER (chooser)((((CtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((chooser)), ((ctk_file_chooser_get_type ())))))), ctk_src_dir, NULL((void*)0)); |
311 | ctk_file_chooser_remove_shortcut_folder (CTK_FILE_CHOOSER (chooser)((((CtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((chooser)), ((ctk_file_chooser_get_type ())))))), ctk_src_dir, NULL((void*)0)); |
312 | ctk_file_chooser_add_shortcut_folder (CTK_FILE_CHOOSER (chooser)((((CtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((chooser)), ((ctk_file_chooser_get_type ())))))), ctk_src_dir, NULL((void*)0)); |
313 | ctk_label_set_mnemonic_widget (CTK_LABEL (label)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((label)), ((ctk_label_get_type ())))))), chooser); |
314 | g_signal_connect (chooser, "current-folder-changed",g_signal_connect_data ((chooser), ("current-folder-changed"), (((GCallback) (chooser_current_folder_changed_cb))), (((void *)0)), ((void*)0), (GConnectFlags) 0) |
315 | G_CALLBACK (chooser_current_folder_changed_cb), NULL)g_signal_connect_data ((chooser), ("current-folder-changed"), (((GCallback) (chooser_current_folder_changed_cb))), (((void *)0)), ((void*)0), (GConnectFlags) 0); |
316 | g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL)g_signal_connect_data ((chooser), ("selection-changed"), (((GCallback ) (chooser_selection_changed_cb))), (((void*)0)), ((void*)0), (GConnectFlags) 0); |
317 | g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL)g_signal_connect_data ((chooser), ("file-activated"), (((GCallback ) (chooser_file_activated_cb))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
318 | g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL)g_signal_connect_data ((chooser), ("update-preview"), (((GCallback ) (chooser_update_preview_cb))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
319 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), chooser, TRUE(!(0)), TRUE(!(0)), 0); |
320 | |
321 | button = ctk_button_new_with_label ("Tests"); |
322 | g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser)g_signal_connect_data ((button), ("clicked"), (((GCallback) ( tests_button_clicked_cb))), (chooser), ((void*)0), (GConnectFlags ) 0); |
323 | ctk_box_pack_start (CTK_BOX (hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((hbox)), ((ctk_box_get_type ())))))), button, FALSE(0), FALSE(0), 0); |
324 | |
325 | g_object_unref (label_group); |
326 | |
327 | ctk_widget_show_all (win); |
328 | ctk_window_present (CTK_WINDOW (win)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((win)), ((ctk_window_get_type ()))))))); |
329 | |
330 | ctk_main (); |
331 | |
332 | return 0; |
333 | } |