GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Jul 24, 2014 8:02 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: GTK+ GUIs the EASY way....
PostPosted: Wed Sep 22, 2010 8:52 am 
Offline
GTK+ Guru

Joined: Sun Jan 17, 2010 6:48 pm
Posts: 102
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

Image


[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]

_________________
"If you don't stand for something, then you'll fall for anything."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group