annotate finch/libgnt/test/file.c @ 32064:4aeca6c1c143

NEWS
author masca@cpw.pidgin.im
date Fri, 13 May 2011 04:33:20 +0000
parents f104e1d45d85
children 57d350900136
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15847
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 #include "gnt.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2 #include "gntfilesel.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3
18510
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
4 static void
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
5 file_selected(GntFileSel *sel, const char *path, const char *filename)
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
6 {
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
7 g_printerr("%s %s\n", path, filename);
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
8 }
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
9
15847
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
10 int main()
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
11 {
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
12 freopen(".error", "w", stderr);
18510
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
13 fprintf(stdout, "\x1b]1;\x07\x1b]2;TEST\x07");
15847
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
14 gnt_init();
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
15
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
16 GntWidget *w = gnt_file_sel_new();
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
17 gnt_file_sel_set_current_location(GNT_FILE_SEL(w), "/home/");
15849
3da9d5da9054 Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15847
diff changeset
18 gnt_file_sel_set_dirs_only(GNT_FILE_SEL(w), TRUE);
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15849
diff changeset
19 gnt_file_sel_set_multi_select(GNT_FILE_SEL(w), TRUE);
15847
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20 gnt_widget_show(w);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
21
18510
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
22 g_signal_connect(G_OBJECT(w), "file_selected", G_CALLBACK(file_selected), NULL);
f104e1d45d85 Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
23
15847
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
24 gnt_main();
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 gnt_quit();
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
27 return 0;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
28 }
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
29