You create a window with Glade.
You also add the callbacks in Glade (what function shall be executed, when e.g. a button is clicked).
Then you run my projectgenerator on the glade-file, and get a bash script, that immedeatly works.
You cannot only "read" the widgets, but also assign values from within bash, like setting text on a label.
This is achieved by using "gtk-server", a wrapper for Bash and other languages for Gtk.
http://www.gtk-server.org
http://www.gtk-server.org/GTK-server_Manual.html
1.) install the pet
2.) run "gtkservergenerator" from the "utilities" or "develop" menu (or using a filemanager: /usr/local/gtk-server-generator/generate-project)
3.) select a glade file, for example /usr/local/gtk-server-generator/test/project.glade. It MUST be named "project.glade"!
4.) click on the button, and after some seconds, rox shows the generated files.
5.) edit the "functions.inc" to your needs.
In the "test", I added two custom actions by hand:
Code: Select all
gtk "gtk_entry_set_text $entry1 \"test 1\""
The default action is just to print the name of the current function to console.
You get an overview of the supported functions in the file /etc/gtk-server-glade.cfg
6.) click on "myproject" to run the generated program/script.
The generated projects use the "IPC" method, to communicate with Gtk-server. This is an internal Linux messaging system, using the process-IDs.
Like this STDOUT and STDIN remain free for your own purposes. I think this is quite an advantage compared to Gtkdialog for example.
http://en.wikipedia.org/wiki/Inter-proc ... munication
Please be aware, that I just finished it, and am tired now. So it is not well tested.
If you receive errors, try to kill gtk-server from console.
Some example-code can be found in the source-pack:
http://downloads.sourceforge.net/gtk-se ... -sr.tar.gz
I compiled the pet in Newyearspup02rc10, it also works in Puppy 4.3.1 and fluppy 005. Requires libglade2, that is part of Puppy as far as I remember..
Mark