Dialogs boxes » History » Version 3
iri, 03/13/2011 12:08 AM
1 | 1 | iri | h1. Dialogs boxes |
---|---|---|---|
2 | |||
3 | !>http://library.gnome.org/devel/gtk/unstable/filechooser.png! |
||
4 | |||
5 | h2. _gtkDialogFileChooserNew |
||
6 | |||
7 | Create and display a File chooser dialog box. |
||
8 | |||
9 | For a better integration, the callback is defined to the creation. |
||
10 | |||
11 | 3 | iri | Prototype : *fun [Chn ObjGtkWidget S P I [[I S S] r1] fun [ObjGtkWidget u0 S] u1 u0] ObjGtkWidget* |
12 | 1 | iri | |
13 | This seems complex but not, it is easy ! |
||
14 | |||
15 | table. |
||
16 | |*channel*|Chn|any channel| | |
||
17 | |*parent*|ObjGtkWidget|the parent|Typically a window| |
||
18 | |*title*|S|a title for the dialog| | |
||
19 | |*initial_path*|P|initial path|Can be nil. If this case, it will be the root active partition| |
||
20 | |*flag*|I|a flag. It can be one of these value|SCOL_GTK_ACTION_OPEN open a file| |
||
21 | | | | |SCOL_GTK_ACTION_SAVE save a file| |
||
22 | | | | |SCOL_GTK_ACTION_SELECT_FOLDER select a folder| |
||
23 | | | | |SCOL_GTK_ACTION_CREATE_FOLDER create a folder| |
||
24 | 2 | iri | |*filters*|[[I S S] r1]|the filters|each tuple is composed by a flag, the filter itself (e.g. "*.png" or "*.txt" ...) and a name which will be displayed |
25 | The flag can be : SCOL_GTK_DIALOG_FILTER_PATTERN (by default), SCOL_GTK_DIALOG_FILTER_MIMETYPE or SCOL_GTK_DIALOG_FILTER_IMAGE| |
||
26 | 1 | iri | |*callback*|fun [ObjGtkWidget u0 S] u1|The callback called when the user click on a button| | |
27 | |*userparam*|u0|user parameter for the callback|at your convenience| |
||
28 | |||
29 | +Return+ : a Scol object or nil if error |
||
30 | |||
31 | h3. About the callback |
||
32 | |||
33 | Its prototype is fun [ObjGtkWidget u0 S] u1 |
||
34 | The supplemental argument is the selected path. This path is relative to the partition. |
||
35 | It needn't to destroy this widget. It should be it automatically. |
||
36 | |||
37 | If the user clicks on the Cancel button or the close icon, the callback won't be called. |
||
38 | If no path is selected or the path is incorect, the supplemental argument is nil. |
||
39 | |||
40 | See [[Examples]] |
||
41 | |||
42 | Return [[Api]] |