Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 31 Oct 2014, 05:55
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Gtkdialog-IDE
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Mon 03 May 2010, 16:29    Post_subject:  Gtkdialog-IDE
Sub_title: A development environment written in Gtkdialog of course!
 

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.php?search_id=345450735&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
gtkdialog-ide.png
Description  Screenshot of gtkdialog-IDE
png

 Download 
Filename  gtkdialog-ide.png 
Filesize  256.88 KB 
Downloaded  750 Time(s) 
gtkdialog-IDE.pet
Description  Development environment for gtkdialog
pet

 Download 
Filename  gtkdialog-IDE.pet 
Filesize  253.63 KB 
Downloaded  602 Time(s) 
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5039
Location: Arizona, U.S.A.

PostPosted: Thu 06 May 2010, 01:33    Post_subject:  

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:
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...
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Thu 06 May 2010, 18:42    Post_subject:  

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 Very Happy )


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) Very Happy
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0698s ][ Queries: 12 (0.0210s) ][ GZIP on ]