Project

General

Profile

Actions

Dialogs boxes » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
iri, 03/13/2011 12:07 AM


Dialogs boxes

_gtkDialogFileChooserNew

Create and display a File chooser dialog box.

For a better integration, the callback is defined to the creation.

Prototype : fun [Chn ObjGtkWidget S P I [[S S] r1] fun [ObjGtkWidget u0 S] u1 u0] ObjGtkWidget

This seems complex but not, it is easy !

channel Chn any channel
parent ObjGtkWidget the parent Typically a window
title S a title for the dialog
initial_path P initial path Can be nil. If this case, it will be the root active partition
flag I a flag. It can be one of these value SCOL_GTK_ACTION_OPEN open a file
SCOL_GTK_ACTION_SAVE save a file
SCOL_GTK_ACTION_SELECT_FOLDER select a folder
SCOL_GTK_ACTION_CREATE_FOLDER create a folder
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
The flag can be : SCOL_GTK_DIALOG_FILTER_PATTERN (by default), SCOL_GTK_DIALOG_FILTER_MIMETYPE or SCOL_GTK_DIALOG_FILTER_IMAGE
callback fun [ObjGtkWidget u0 S] u1 The callback called when the user click on a button
userparam u0 user parameter for the callback at your convenience

Return : a Scol object or nil if error

About the callback

Its prototype is fun [ObjGtkWidget u0 S] u1
The supplemental argument is the selected path. This path is relative to the partition.
It needn't to destroy this widget. It should be it automatically.

If the user clicks on the Cancel button or the close icon, the callback won't be called.
If no path is selected or the path is incorect, the supplemental argument is nil.

See Examples

Return Api

Updated by iri over 13 years ago · 2 revisions