Hi there,
Producing a workable UI at speed is a nightmare unless you have the right tools.
Based upon your needs I created the following script within 10mins. All that is required is to set the
utility and
options variables to your required defaults and modify the
'exec' string.
To run the script you will need to have Tcl 8.+ on your machine (packaged with all distros) and install Gnocl from the SourceForge repositories. At:
http://sourceforge.net/projects/gnocl/files/
If you don't wish to compile the source code, 32/64 bit binaries are available for download.
Will
[code=]#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package require Gnocl
#set default utility name
set utility ls
set infile -noname-
set outfile -noname-
set options ""
set table [gnocl::table -homogeneous 0]
$table addRow \
[list [gnocl::label -text "Utlity"] \
[gnocl::entry -variable utility] ]
$table addRow \
[list [gnocl::label -text "Infile"] \
[gnocl::entry -variable infile] \
[gnocl::button \
-onClicked { set infile [gnocl::fileChooserDialog -title "Pick file to convert"] } \
-icon "%#Open" \
-tooltip "Pick file"] ]
$table addRow \
[list [gnocl::label -text "OutFile"] \
[gnocl::entry -variable outfile] ]
$table addRow \
[list [gnocl::label -text "Options"] \
[gnocl::entry -variable options] ]
$table addRow \
[list "" [gnocl::button \
-text Execute \
-onClicked {eval exec $utility $options $infile $outfile} \
-tooltip "Run job" ] ]
gnocl::window \
-title "My Command Front End" \
-child $table \
-defaultWidth 120 \
-defaultHeight 120 \
-allowGrow 0 \
-allowShrink 0
gnocl::mainLoop
[/code]