Tuesday, May 16, 2017

Creating previews with the File Chooser Dialog


I'm currently doing something of a spring-clean of the source code and noticed that the image and filechoose dialog options really didn't work too well together in order to create previews. So, the modifications to the current nightly build will allow scaling and constraints on image dimensions without the need for lengthy, and potentially cycle consuming Tcl scripting.

Here's a code snippet...

set pv(1) [gnocl::image ]

set fname [gnocl::fileChooserDialog \
    -previewWidget $pv(1) \

    -onFileSelectionChanged { $pv(1) configure -image %/%f -constrainWidth 200 }]

No comments: