Gtkdialog-IDE

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Gtkdialog-IDE

#1 Post by seaside »

When trying to do a GUI in Gtkdialog, I found that "the faster I could produce an error, the quicker I found the working solution". This led to pasting code into terminals which is ok, but has many limitations and led me to put together the following environment.

Here's Gtkdialog IDE. It's created in Gtkdialog3 and consists of two panes - on the left is where you put basic gtkdialog xml code without the header and footer lines (GUI=' and gtkdialog -p GUI). You can choose starter code from a library (I use the Gtkdialog examples directory, filtering out comments,single quotes, head & foot GUI lines) and then enhance these by picking items under Signals, Properties or Tags on the menubar and pasting (CTRL+V). NOTE: if you have xdotool you can uncomment the xdotool parts in the "clipon" and "tagclipon" functions and get instant paste. You can get xdotool by installing Pastelist.pet found here
http://murga-linux.com/puppy/viewtopic. ... 35&t=45327

You can use comments in the XML code and escaping isn't necessary (Yes!). Three data files- "signals" "properties" and "tagsfile"- hold the xml choices and should be installed in the same directory as Gtkdialog IDE.

On the right is the Function Code pane. You can try out code to run with the GUI by clicking "Test Function" and it'll run in a terminal - variables and functions do not need to be exported here.

When you've completed the GUI XML code, you can immediately run it by clicking on "Run GUI" and it'll run in a terminal so you can see errors. When "Run GUI" is clicked, both the XML Code and the Function Code are merged before running.Also, the variable "CHOICES" is set for evaluation.

If you have text markup to add, you can click on "Markup Editor" to try out and add text markup.

When both testing of the GUI XML and Function codes are working as expected, then the complete GUI program can be saved by clicking on "Save GUI".

If you have unresolved errors stemming from incomplete tags, you can click on "Tag Tester" which requires Sunburnt's program "gtkdialog.tester" which can be found here -
http://murga-linux.com/puppy/viewtopic.php?t=53608

There may be some missing or little used tags,properties, or signals and it's easy enough to add or subtract items by
editing the corresponding files to suit.

A Gtkdialog-IDE pet follows and installs to /root/my-applications and appears in the menu under utilities.

There's a screen shot below.

Run Gui, run,
S

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

Hi seaside; Very nice! It`s much like the gtkdialog GUI builder that I started way back.
Except mine didn`t bother to show the tags ( unneeded ). Also I had it running the code active.
So as you made changes, the GUI being built would restart showing the change ( like V.B. ).
If the new code errored it would undo to the last step, pretty simple stuff really...
My right pane was functions also, but the left pane code looked like this ( much thinner ):

Code: Select all

vb
tbl
var TABLE
in /tmp/input.file
hb
chk
lbl Do it or not
act refresh TABLE
btn
lbl Click Me
act ckBTN
/hb
/vb
You can see how much easier this code is to read and deal with than XML.
Also no closing tags for the controls, they`re not needed, just hbox (/hb) and vbox (/vb).
The only one that does need a closing tag that I can remember is the NoteBook.
That`s XML... All the other tags don`t need closing counter parts ( what a waste...).
The builder accepted full names for the tags as well as the shortened ones.
A library converted this short hand script into fully tagged gtkdialog code.
It`d be interesting to get yours running the GUI actively ( and maybe some pane options ).
I haven`t been up to par recently, so I haven`t had the chance to try your creation yet...

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#3 Post by seaside »

Sunburnt,

Thanks, and I agree with you that staring at XML code tends to create brain scrambling. (Although, not as bad as trying to decipher Sed random criss-crossing and escaping pickets :D )


What would really be great is perhaps a 5 X 10 matrix panel consisting of widget placements corresponding to boxes on the GUI screen. (Not sure that's descriptive enough, but perhaps you get the idea)

In this way you could get the placement of widgets (buttons, tables, combobox, etc. ) in the appropriate screen location and just have a name (like combobox) for a particular grid screen box. e.g screenbox col, row

box (1,1) =table+signals+properties+tags
box (1,5)=button+signals+properties+tags

Widget placement and code by simple name.

All your good stuff like backup to last run on error, libraries, incremental build.

Great stuff.

Cheers,
s
(Don't like to hear that you've been sub-par lately and hope you'll be shooting "Par" very shortly) :D

Post Reply