Dialogs boxes » History » Version 1
iri, 03/06/2011 11:24 PM
| 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 | Prototype : *fun [Chn ObjGtkWidget S P I [[S S] r1] fun [ObjGtkWidget u0 S] u1 u0] ObjGtkWidget* |
||
| 12 | |||
| 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 | |*filters*|[[S S] r1]|the filters|each tuple is composed by the filter itself (e.g. "*.png" or "*.txt" ...) and a name which will be displayed| |
||
| 25 | |*callback*|fun [ObjGtkWidget u0 S] u1|The callback called when the user click on a button| | |
||
| 26 | |*userparam*|u0|user parameter for the callback|at your convenience| |
||
| 27 | |||
| 28 | +Return+ : a Scol object or nil if error |
||
| 29 | |||
| 30 | h3. About the callback |
||
| 31 | |||
| 32 | Its prototype is fun [ObjGtkWidget u0 S] u1 |
||
| 33 | The supplemental argument is the selected path. This path is relative to the partition. |
||
| 34 | It needn't to destroy this widget. It should be it automatically. |
||
| 35 | |||
| 36 | If the user clicks on the Cancel button or the close icon, the callback won't be called. |
||
| 37 | If no path is selected or the path is incorect, the supplemental argument is nil. |
||
| 38 | |||
| 39 | See [[Examples]] |
||
| 40 | |||
| 41 | Return [[Api]] |