Mercurial > pidgin
annotate finch/libgnt/test/file.c @ 18510:f104e1d45d85
Changes to the test apps.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 13 Jul 2007 01:30:08 +0000 |
parents | f00f2e283ffb |
children | 57d350900136 |
rev | line source |
---|---|
15846
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:
15928
diff
changeset
|
4 static void |
f104e1d45d85
Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
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:
15928
diff
changeset
|
6 { |
f104e1d45d85
Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
7 g_printerr("%s %s\n", path, filename); |
f104e1d45d85
Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
8 } |
f104e1d45d85
Changes to the test apps.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
9 |
15846
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:
15928
diff
changeset
|
13 fprintf(stdout, "\x1b]1;\x07\x1b]2;TEST\x07"); |
15846
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/"); |
15848
3da9d5da9054
Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15846
diff
changeset
|
18 gnt_file_sel_set_dirs_only(GNT_FILE_SEL(w), TRUE); |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15848
diff
changeset
|
19 gnt_file_sel_set_multi_select(GNT_FILE_SEL(w), TRUE); |
15846
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:
15928
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:
15928
diff
changeset
|
23 |
15846
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 |