Can't find GOOD tutorial for gtkDialog, indepth examples.

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Can't find GOOD tutorial for gtkDialog, indepth examples.

#1 Post by sunburnt »

The gtkDialog site's tutorial doesn't show anything about the HTML code I'm using.
I need examples of how to:

absolutely size & position widgets, & windows - at GUI start & in running code
call bash code & functions; <action>(word that calls function):AddClient</action>
overlay widgets on top of other widgets & set which is on top
complete examples of useing the file dialog & other premade dialogs

These are the equivalents of VB's; properties, events, & methods.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#2 Post by rarsa »

First the bad news:
gtkdialog is not as functional as the web page makes you believe. I tried with infructuose results to make it work as expected.

It was a real nightmare to make the puppy networking wizard look the way it looks. I am seriously thinking on changing it to tcl/tk.

Actually I found version 0.59.8 to be worst than 0.58.8 (both included in puppy).

Second the good news:
I found many workarounds for the gtkdialog shortcomings while working on the networking wizard.

If you have specific questions I will be glad to help you.

Oh, and just to clarify: the gtkdialog window definition is not HTML or even XML. The markup language may be simmilar but its definetivelly different.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

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

#3 Post by sunburnt »

I can't say I'm suprised, HTML is a stupidly conceived language (and this is the best that MIT's best could do?), & if gtkDialog like HTML pages can't control object position & Z order (top placement), it isn't fit for full blown applications.
Still... it should do fine for something as simple as I'm doing.

So I assume then gtkDialog can not position widgets other than <vbox> & <hbox>?

How to call specific sections of code (use if ... fi somehow?), & call functions?
Start FileDialogBox with a given path, & then get the Path+FileName return?
I may need help getting the table widget to work, I haven't got that far yet.

Observation; Gnome has advanced programming languages, mono (M$ DotNet clone), & Glade (visual IDE for gtkDialog).
This might be a good reason to get it running on Puppy, & there may be other good reasons for it.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

Gtkdialog is "just" a small set of easy to use Widgets for Shell-scripters.

For more influence,you need a "real" programming-language with bindings to Gtk itself.
This will allow to alter every widget in Detail, you even can add your own events (like replacing the mouseover-action of a button with own functions).

Puppy has wxbasic and Gtkperl.
As both were not designed for Puppy, there is no specificdocumentation available, just the general one.

Gtk-Perl
http://www.murga.org/~puppy/viewtopic.php?t=4193
http://personal.riverusers.com/~swilhel ... -tutorial/

wxperl (not yet available, will try to add it)
http://wxperl.sourceforge.net

wxbasic
http://www.murga.org/~puppy/viewtopic.php?t=2339
http://wxbasic.de

Mark

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#5 Post by rarsa »

I will try again to clarify some obvious confusions:
sunburnt wrote:I can't say I'm suprised, HTML is a stupidly conceived language
Again. What does HTML have to do with this? Answer: Nothing.
sunburnt wrote:it isn't fit for full blown applications.
Still
Well, it isn't meant for full blown applications.
sunburnt wrote:Gnome has advanced programming languages, mono (M$ DotNet clone), & Glade (visual IDE for gtkDialog).
I think you are confusing GtkDialog with Gtkdialog may the name be the same but they are different things.

The former is a library to write full blown applications. the latter is ".. a small utility for fast and easy GUI building".
This might be a good reason to get it running on Puppy, & there may be other good reasons for it.
You don't need Gnome to run GTK or GTK+. Actually there are apps in puppy that use the GTK, for example gplaycd.

Having clarified that HTML has nothing to do with GTKdialog or gtkdialog or GtkDialog or any variation. I would like to take exception to your contempt of HTML.

Dynamic and relative possitioning is what allows well designed pages to show correctly in a variety of different devices. From web broswers in tiny screens to devices that allow blind people to listen to web sites to text based browsers to different resolution on desktop screens.

Actually it is my personal opinion that static positioning usually sucks. Actually I would say that you should have very good reasons for designing an application with static positioning.

A good example of this is: Some applications have the 'file open' dialog with static positioning. Other applications allow you to resize the dialog which repositions the buttons and allows expanding the file list. You tell me which one you prefer.

Another example: Have you ever been frustrated trying to read a web site designed specifically for 800x600 with a monitor in a higher or lower resolution? With a higher resolution even maximizing the browser keeps the content aligned to the old margins while half of your screen is unused. With a lower resolution, you need to scroll horizontally.

Well, you get the idea.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#6 Post by Nathan F »

Still basically unanswered, is there a good tutorial on the concepts somewhere? I've just gotten the hang of using xmessage properly and would really like to create some better looking wizards and such. I'd be more than willing to try wxbasic too but don't really know where to start, other than examining the scripts already in Puppy.

Nathan
Bring on the locusts ...

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#7 Post by MU »

wxbasic has no tutorial, just Data-sheets and lots of examples in the wxbasic-forum.
So Gtk-perl might be better, as the mentioned tutorial is very good, and Perl+Gtkperl is just 2.3 MB.

For Puppybasic there is a mini-tutorial here:

http://noforum.de/wxBasicscript-documen ... /index.htm
It still uses the old, depreciated name wxbasicscript.

Mark

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#8 Post by rarsa »

Not a tutorial, but if you have a look at the network wizard you'll see how to call specific functions based on user actions.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

#9 Post by jmarsden »

This whole thread seems really confusing or confused. Or I'm missing the point? Overall it sounds as though sunburnt asked a question at too low a level for what he really wanted, and so the resulting discussion hasn't been all that coherent or easy to follow.

Puppy contains a perfectly good scripting language with GUI capabilities: Tcl/Tk. Given that situation, and the general "keep it small" Puppy approach, why would we be working at either making various little dialog tools do more than they were ever really designed for, or using other less portable less common scripting systems and languages such as wxbasic?

sunburnt: Have you tried learning and using Tcl/Tk? There are multiple online tutorials and books for those who want to learn about using it. Pointers to some of them have been posted in these forums. A really simple tutorial for gently getting started is at http://www.ardenstone.com/projects/seniorsem/tcl/ . One old but good starting point for other resources is probably http://hegel.ittc.ku.edu/topics/tcltk/ or you can try http://www.freeprogrammingresources.com/tcl.html . If you prefer a printed paper book, try http://www.beedub.com/book/ (read sample chapters, then decide if you want to buy the paper book). This book (by Welch) is IMO the "best" Tcl/Tk book out there.

Summary: If you are looking for a useful (and free and open source and portable!) scripting language in Puppy that can allow the creation and use of GUI interfaces, I suggest that you first try the one that Puppy already includes (Tcl/Tk), before you resort to messy over-use of gtkdialog and similar shell script addons, or to other add-on scripting systems and languages that are not native to Puppy, which would mean that the results of your scripting labours would be less easily usable by the rest of the Puppy user community.

Jonathan

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#10 Post by MU »

wxBasic is portable, it runs in Windoze, Linux and MacOSX.
You could compile it on almost any system supporting wxWidgets.

I tried Tcl/Tk some years ago,and found it wasthe pure Horror.
But at that time, there was no good documentation yet, so today I might judge different.

wxBasic has the advantage, that people with knowledge in Visual Basic just have to learn the new wxWidgets-classes, but still can use "Basic".

But the lack of documentation is an argument against it.
So I suggested Gtkperl, that is small too, OpenSource, "native" (Gtk), and (just imho) easier than Tcl/Tk. But that is a very individual view of course.

Mark

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

#11 Post by sunburnt »

Many thanks to one and all, the front end I have in mind for LanPuppy isn't demanding & is rather simple.
A TabPanel with specific management functions on each tab.

Users OnLine; a table showing users logged in, & [User Info], [Message User], [Kick User] buttons.
User Accounts; a table showing all users, [Add Users], [Del. User], [User Info], [Message User] buttons.
Client Accounts; a table showing computers allowed to connect, [Add Client], [Delete Client] buttons.
LanPup Setup; options for: login or no-login, allow user to use a USB flash drive, allow root login from client, & others.

I think that this can be done with only gtkdialog & bash script, it's just not that hard an app. to do.
Users will be handled by Samba (I have more reading to do), & clients will be bash modifying the dhcpd.conf file.
LanPup Setup will be bash reading & writing the settings in the lanpup.cfg file & changing LanPuppy startup scripts.

I've looked at tcl/tk, I understood it, but never did anything with it, it'd probably be much better for larger apps.

Puppy Basic I understood immediately, & it seems it can have full use of wxBasic, & other resources as well.
Hmmmm... now to interperet VB syntax to gtkdialog to complete the picture, but with Gnome's Glade it's not needed.

I think I've figured out calling bash scripts, but I'm still vauge on the file dialog box use (open with a given path).
I still don't know if <hbox><vbox> are the only way to position widgets, & if <width><height> are only for some widgets.
Attachments
LanAdmin_SS.png
(7.98 KiB) Downloaded 674 times

Post Reply