# dialog.image

Shows a image dialog

Syntax

    dialog.image(<type>,<caption>,<initial_directory>,[<maxsize>,[,<magic1>[,<magic2>[...]]]]]])
    {
        <callback_command>
    }

Description

Shows a dialog that allows selecting an [doc:image_id]image_id[doc]. The <type> parameter must be a combination of the following flags:<br> 's' : allow selecting from the KVIrc builtin small icons<br> 'b' : allow selecting from the KVIrc builtin big icons<br> 'f' : allow browsing the local directories<br> 'a' : all of the above<br> The default for <type> is 'a'.<br> <caption> is the caption string for the dialog.<br> <initial_directory> makes sense only if 'f' is specified (if <initial_directory> is empty then the last path used by the image dialog will be used).<br> <maxsize> is the maximum size of the images for that the preview will be generated: this is 256000 bytes by default (if unspecified). Don't make it a lot bigger : it can take a lot to make the thumbnails for bigger images (and it can eat a considerable amount of memory).<br> <magic1>,<magic2>... are the magic parameters: evaluated at dialog.image call time and passed to the <callback_command> as positional parameters.
Once the dialog has been shown , the user will select an EXISTING file and click either Ok or Cancel. At this point the dialog is hidden and the <callback_command> is executed passing the selected file(s) as $0 and the magic parameters as positional parameters $1 , $2 , $3....
If the user clicks "Cancel" or does not select any image the positional parameter $0 will be empty.

Examples

        dialog.image(f,Choose an image file,/home/pragma/,"256000")
        {
            if("$0" != "")run kview $0
        }

Main index, Command index

KVirc 3.0.0 documentation
Generated by root at Thu Apr 29 12:41:05 2004