GTK+2 + Bash

William Park opengeometry-FFYn/CNdgSA at public.gmane.org
Mon Jul 11 15:54:10 UTC 2005


For your reading pleasure, this is a copy of what I posted to
<comp.unix.shell>.


I'm very excited to announce shell interface to GTK+2 (2.6.1) for Bash.
It read XML syntax describing the widget layout, and returns user
selection as shell variable or runs shell command as callback.  It's
designed for simple GUI dialog or layout, with the emphasis on getting
the user data back into shell.

For the moment, the shell variable and command are disabled.  It just
prints to stdout, instead.  But, you can change it easily.


Ref:
    http://freshmeat.net/projects/bashdiff/
    http://home.eol.ca/~parkw/index.html#gtk

Usage:
    gtk < file.xml
    gtk file.xml...


For example, GTK+2 tutorial has 2 button 'helloworld2.c',

    http://www.gtk.org/tutorial/sec-anupgradedhelloworld.html
    http://www.gtk.org/tutorial/images/helloworld2.png

You can now build the same thing with

    <window border="10" label="Hello Buttons!">
	<hbox>
	    <button label="Button 1" clicked="echo Button 1 was pressed" />
	    <button label="Button 2" clicked="echo Button 2 was pressed" />
	</hbox>
    </window>

Or, 

    gtk << EOF
	<window>
	    ...
	</window>
    EOF


Feedbacks are welcome.  Enjoy!

-- 
William Park <opengeometry-FFYn/CNdgSA at public.gmane.org>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list