J?rgen Kahrs <Ju************ **********@vr-web.de> wrote:
Hello William,
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>
Do you have a pointer to a description of the XML
data that is accepted by GTK and by your extended bash ?
Hi Juergen,
It uses Expat to parse the input syntax. As for the actual format, you
can only have 2 variations:
<tag att="value" ...></tag>
<tag att="value"/>
where
<tag></tag> is used for widget which contains child widget.
Currently supported tags are listed in
http://home.eol.ca/~parkw/index.html#gtk
It's the same help file that you get from
help gtk
I'll add more examples to the website. Right now, it can do most
'dialog' and 'Xdialog' stuffs, except for calendar. I'll add it soon.
It's really designed for presenting relatively static and simple GUI
layout or dialog. And, getting the info back into shell script.
Is this some kind of competition for Mozilla's XUL ?
Unfortunately, no. I looked at XUL, and couldn't understand it. You
can display buttons or text fields. Okey, so user clicks a button or
types some text. How do you find out which button he clicked or what he
typed? Because I need that info in my shell script.
I looked at Tk + Ksh. I could've done the same thing for GTK+, that is,
function for function binding. But, it's downright criminal to force
that kind of details onto users.
The best comparison is 'gtkdialog'. It also uses XML syntax, but uses
lex/yacc to parse it. Because it's separate program, I have the same
problem of getting data back into shell, as using 'awk' or 'sed'.
Since I do Expat already, I used the same mechanism. Expat calls
start_handler
end_handler
data_handler
as it encounters various tags. From here, I call relevant GTK+
functions and in right order. 'start_handler' is massive. :-)
Fortunately, the order of GTK+ call is pretty much in sync with the
order of Expat callbacks. You don't have to fake it much.
--
William Park <op**********@y ahoo.ca>, 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/