GtkDialog - tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#541 Post by disciple »

Hi guys,
I think it would be really good to build a list of all significant gtkdialog programs. I have made a thread at http://www.murga-linux.com/puppy/viewto ... 775#537775
Which ones can you remember that I've missed?
Do you know of any other distros (or developers using other distros) that make or have made extensive use of gtkdialog?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#542 Post by 8-bit »

I saw your start of a list post disciple. Good work.

Also, for those interested in examining others gtkdialog scripts to learn,
there is a very good article on building a GUI using gtkdialog by
PCLinuxOS magazine.
I found it on the developer site created by thunor.

It is an interesting read and the source to the script is included there.
It was written for a KDE linux so some things will not work without modification.
The direct link is http://pclosmag.com/html/Issues/200910/page21.html.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

gif animation

#543 Post by vovchik »

Dear thunor,

I compiled your 14th mod and noticed that I do not get multiple gif animation any more - at least not in Pzombie. Please have a look at thishttp://www.murga-linux.com/puppy/viewto ... chik[/img]

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#544 Post by Aitch »

sorted out, this reads
Vovchik wrote: Dear thunor,

I compiled your 14th mod and noticed that I do not get multiple gif animation any more - at least not in Pzombie.
Please have a look at this

http://www.murga-linux.com/puppy/viewto ... 4c61c490e0

... if you can. I use multiple gifs in that little script...

With thanks in advance and kind regards,
vovchik
Aitch :)

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#545 Post by thunor »

Aitch wrote:sorted out, this reads
Vovchik wrote: Dear thunor,

I compiled your 14th mod and noticed that I do not get multiple gif animation any more - at least not in Pzombie.
Please have a look at this

http://www.murga-linux.com/puppy/viewto ... 4c61c490e0

... if you can. I use multiple gifs in that little script...

With thanks in advance and kind regards,
vovchik
Aitch :)
Hi vovchik and Aitch

<pixmap> widget 0.7.20 syntax:

Code: Select all

<pixmap tag_attr="n" tag_attr="n" ...>
	<variable>varname</variable>
	<visible>state</visible>
	<input file stock="gtk-image"></input>
	<input file>filename</input>
</pixmap>
<pixmap> widget 0.7.21 syntax:

Code: Select all

<pixmap tag_attr="n" tag_attr="n" ...>
	<variable>varname</variable>
	<visible>state</visible>
	<width>n</width>				## Width to scale image
	<height>n</height>				## Height to scale image
	<input file stock="gtk-image"></input>
	<input file>filename</input>
</pixmap>
This is a snippet from your pzombie application. You are erroneously using directives that previously had no effect:

Code: Select all

<pixmap>
	<width>78</width>
	<input file>'$g9_img'</input>
</pixmap>
<pixmap>
	<width>78</width>
	<input file>'$g9_img'</input>
</pixmap>
etc. etc. etc., there's several of them.
This is the syntactically correct code:

Code: Select all

<pixmap width-request="78">
	<input file>'$g9_img'</input>
</pixmap>
<pixmap width-request="78">
	<input file>'$g9_img'</input>
</pixmap>
etc. etc. etc., there's several of them.
In fact the image is 78 anyway so requesting it is unnecessary.

These are your Close, About and Exit buttons. You are erroneously using directives that previously had no effect and you have a missing height-request="40":

Code: Select all

<button width-request="90">
	<height>40</height>
	<input file>'$g7_img'</input>
	<label>Close </label>
	<action>closewindow:show_about</action>
</button>
...
<button width-request="90" height-request="40">
	<height>40</height>
	<input file>'$g0_img'</input>
	<label> About  </label>						
	<action type="launch">show_about</action>
</button>
<button width-request="90" height-request="40">
	<height>40</height>
	<input file>'$g5_img'</input>
	<label> Exit  </label>
	<action type="exit">=quit</action>
</button>
This is the syntactically correct code:

Code: Select all

<button width-request="90" height-request="40">
	<input file>'$g7_img'</input>
	<label>Close </label>
	<action>closewindow:show_about</action>
</button>
...
<button width-request="90" height-request="40">
	<input file>'$g0_img'</input>
	<label> About  </label>						
	<action type="launch">show_about</action>
</button>
<button width-request="90" height-request="40">
	<input file>'$g5_img'</input>
	<label> Exit  </label>
	<action type="exit">=quit</action>
</button>
Regards,
Thunor
Last edited by thunor on Sun 26 Jun 2011, 08:57, edited 2 times in total.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Thanks a million

#546 Post by vovchik »

Dear thunor,

Thanks for the syntax fixes. I will post Pzombie again, as well as all my other gtkdialog scripts, with proper syntax (e.g. basho-bash, gxlat, markup editor, etc.). I had problems closing child windows with a button but just figured that bit out. :)

With kind regards,
vovchik

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#547 Post by 8-bit »

What I would like to see included in thunor's ongoing updates to gtkdialog is snapshots of it as updates get made to it.
It would be the most current version including all additions and updates.
It would save a lot of compiling each time a new feature or widget is added.
My problem is I am at a loss trying to keep up.

But I think a post that got updated as needed including the most recent update to gtkdialog would be great.

Also, with Zigbert maintaining a sort of manual, his tips post could be updated to show the added features and widgets with examples.

Am I asking too much?

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#548 Post by zigbert »

8-bit
Look at this - thunor has started to document his work. That man has a huge resource.

http://code.google.com/p/gtkdialog/w/list

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#549 Post by 8-bit »

zigbert,
I will agree with you that thunor is doing a great job with gtkdialog as well as examples and usage explanations.
Changes are progressing so fast that it is hard to keep up and I am never quite sure what source files to download for trying to compile the latest.
So I guess I will just have to wait even though I am quite excited by the progress and new features.

I tried downloading the source files shown once and putting them in my gtkdialog src directory.
But I must have missed something because I cannot get it to compile.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#550 Post by 01micko »

Hi 8-bit

This is my routine :wink: (this all in one terminal but you could make a script if you want). I just download it to /root, it's not that big.

Code: Select all

# svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog-read-only
# cd gtkdialog-read-only
# make clean
# ./autogen.sh
# make
# cd src
# cp -a gtkdialog gtkdialog3
# strip gtkdialog3 
#cp -af gtkdialog3 /usr/sbin
That's it! It's your ready to go. Optionally you can backup your original, but I haven't bothered lately.

On subsequent checkouts only the files that are new are overwritten, that's why make clean is important too. I always use autogen.sh too, something may have changed in the generated configure script and that overwrites it. You can run ./autogen.sh --prefix=/usr if you want too.

Cheers

(path corrected, thanks 8-bit)
Last edited by 01micko on Mon 27 Jun 2011, 21:25, edited 1 time in total.
Puppy Linux Blog - contact me for access

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#551 Post by disciple »

8-bit wrote:I tried downloading the source files shown once and putting them in my gtkdialog src directory.
But I must have missed something because I cannot get it to compile.
If you still have trouble, post the actual problem.

Last time I updated svn (yesterday) I found make clean wasn't enough and building was failing with a weird error. I fixed it by explicitly reverting everything, so I guess that must have deleted some autogenerated file that make clean didn't revert.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#552 Post by 8-bit »

01micko,
What can I say? I never did know the ins and outs of getting the source code for downloading and was trying to go to the site and download each file individually. That was my first mistake.
So your howto helped a lot.
I still got an error using "make clean", but ignored it and went ahead and compiled and stripped the resulting file.
Now the latest example works! :D
You have to remember that this is a learning process for me.

Along the same line, I am playing around with the System Information gtkdialog gui that I got from the PC Linux Magazine OS link on thunor's development site.
So far it has been a learning experience and also of a binary called "zenity" that can be used with gtkdialog.
Since zenity is part of puppy, that was interesting.

Also, You show copying gtkdialog3 to /usr/bin when in fact it should be /usr/sbin to maintain original placement.

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

#553 Post by seaside »

8-bit wrote:01micko,

Along the same line, I am playing around with the System Information gtkdialog gui that I got from the PC Linux Magazine OS link on thunor's development site.
So far it has been a learning experience and also of a binary called "zenity" that can be used with gtkdialog.
Since zenity is part of puppy, that was interesting.

.
8-bit,

For examples of what can be done with Gtkdialog, no better place than the various pups can be found. Control panels, simple programs, elaborate programs, utilities.etc.

Led by Zigbert, along with others, puppy pioneered and pushed Gtkdialog further than any other distro around.

Zenity has been taken over by YAD (Yet Another Dialog) which is being actively developed (see thread in Programming). Although it isn't in the general puppy releases, it can be downloaded as a pet.

Cheers,
s

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#554 Post by 8-bit »

seaside, thank you for that information.
I did not know that zenity had been taken over by YAD.

But the System Info GUI script was still interesting and I have and still am going through it to see what works with Puppy and what does not.
I have made some changes to the script to try to get puppy compatability, with icon changes and called applications.
I have not broke it yet and I figure since it was released under a gpl license, I can go ahead and play with it.
If I get anything that looks promising, I may share me efforts.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#555 Post by pemasu »

Just downloaded the latest source and compiled the gtkdialog.
I installed it to the Midnight Sun Pup.
Smokey01 confirmed that quit button did not work in gtkdialog apps.
To be sure I redownloaded the source as posted above by 01micko and compiled it again. Same problem. Quit button does not close app.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#556 Post by 8-bit »

I had downloaded and compiled the source on June 27th at 9:37 am.
I had no problems with the close or exit buttons in programs.
What programs did you use for reference to verify this?

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#557 Post by smokey01 »

It was only the button in partview. The other apps I tested, the close button seem to work ok.

I think the problem is with partview not gtkdialog.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#558 Post by pemasu »

I was sure I got nonworking quit button with some other gtkdialog application also. I recompiled the latest gtkdialog again. I cant reproduce the problem with any other than Partview, all the other apps I tested works as it should. Reverting back to the Patriots gtkdialog version restores the Partview Quit button usage.

Sorry, it seems there is so far only Partview in my Puppies which does not work as it should.
I have used in woof partview-2.1.pet. It is from quirky repo.
http://distro.ibiblio.org/quirky/pet_pa ... ew-2.1.pet

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#559 Post by thunor »

pemasu wrote:I was sure I got nonworking quit button with some other gtkdialog application also. I recompiled the latest gtkdialog again. I cant reproduce the problem with any other than Partview, all the other apps I tested works as it should. Reverting back to the Patriots gtkdialog version restores the Partview Quit button usage.

Sorry, it seems there is so far only Partview in my Puppies which does not work as it should.
I have used in woof partview-2.1.pet. It is from quirky repo.
http://distro.ibiblio.org/quirky/pet_pa ... ew-2.1.pet
Hi pemasu

I was intrigued so I took a look. /usr/sbin/partview uses a perl script to create /tmp/partview.glade which is passed to gtkdialog3.

Yes it quits using the gtkdialog3 binary that came with my lupu 520, but I compiled gtkdialog3-0.7.20-pe-1, edited /usr/sbin/partview to use that instead and I experienced the same problem. There's a message in the terminal which will help to resolve it:

Code: Select all

** (gtkdialog:8741): CRITICAL **: on_any_button_clicked: assertion `command != NULL' failed
Ok, I found bugs in glade_support.c which have always been there, the same bug in 3 functions. The functions should have been checking that "full_command" (the string passed in) was not NULL but were instead checking that a newly allocated uninitialised local pointer called "command" was not NULL ;) I've fixed them but I'm not committing until tomorrow as I have a huge amount of new code to check before I do :D

Regards,
Thunor

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#560 Post by zigbert »

thunor wrote:I've fixed them but I'm not committing until tomorrow as I have a huge amount of new code to check before I do :D
You are just wonderful!

Post Reply