GtkDialog - tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#526 Post by zigbert »

smokey01
This is already supported

Code: Select all

#!/bin/sh

export ok_box='
<window>
 <vbox> 
  <text><label>press _enter_ to activate OK-button</label></text>
  <hbox>
   <button can-default="true" has-default="true" use-stock="true">
    <input file icon="gtk-ok"></input>
    <label>Ok</label>
   </button>
  </hbox>
 </vbox>
</window>'
gtkdialog3 -p ok_box

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

#527 Post by smokey01 »

Thanks Zigbert. I have been trying to find that for ages.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#528 Post by sc0ttman »

zigbert wrote:sc0ttman
What is wrong with using yad, bacon or xdialog?
Nothing, I wasn't saying people should avoid them - I love Xdialog.. Yad is nice too.. Haven't tried bacon, but I bet it's also nice.. But, for example, Yad requires a fairly new GTK, so GTK Dialog will work on systems where Yad does not..

I just think maybe we could ask others, who prefer Yad, what they think is missing in GTK-Dialog ...
Just a suggestion.
zigbert wrote:regarding backwards compatibility, what is the problem with fixing the xml code in IPConfig or other. The big deal about gtkdialog (as I see it) is that
Would just be nice if all the existing scripts we have in Puppy (many of which are no longer maintained by anyone in particular) still work as they are, that's all.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

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

#529 Post by zigbert »

smokey01 wrote:Thanks Zigbert. I have been trying to find that for ages.
I have added the tip to the main post

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

#530 Post by zigbert »

sc0ttman
Don't get me wrong, I see nothing bad in either extended features or backward compatibility...... But I see thunor in a vulnerable position. He will likely get bombed with requests of new heavy tasks. I think we should motivate and help him instead of asking him to save the world.

I see it often when I ask for help/suggestions that the replies is; 'I would like to see this/that feature'...... instead of actually help out. I don't say that the suggester should implement the feature, but if he really investigated the issue, he probably could be of great help with his new knowledge. Most often, I get a link to a web-page, and the user might think he helped out....... I don't know?


Sigmund

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

#531 Post by 8-bit »

In my case, beside looking at Zigbert's GTKDialog - tips, I assumed and still do to an extent that I can learn of some of the possible additions by examining the GTK and GTK+ source code.

Am I wrong there?

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

#532 Post by thunor »

zigbert, I'll get back to you on your list in the future :)
8-bit wrote:One thing I am a little concerned about is that Puppy was using gtkdialog3.
And all your scripts show using gtkdialog, which was the starting one and went from it to gtkdialog2 and finally 3.
I realize I can create syslinks for gtkdialog using other version names.
The reason for the syslinks is so existing gtkdialog scripts used in Puppy will still work.
I've placed and will place a note atop examples about the version required and how to deal with the possibility of a "gtkdialog" name conflict on Puppy Linux :) Other than that, the binary renaming on Puppy doesn't involve me.
sc0ttman wrote:I would like to see a very high priority put into making backwards compatibility 100% stable..

For example, the IPConfig tool breaks (in Wary, I think) when the new gtkdialog is used, apparently..
...
I have heard lots of people prefer Yad to GTK-Dialog..

...but users on this forum are now creating more and more Yad GUIs...
I'm not aware that I have broken anything. I haven't replaced code, I've added code to support new functionality. I agree that backwards compatibility is important, but equally so is maintaining applications.

I can't comment on "IPConfig" as I'm using lupu-520 and I don't have it (or can't find it). Feel free to use the issue tracking system if you think it's a problem with gtkdialog[-0.7.21 SVN].

I don't want to take over the world! :P Folk can use whatever dev-tools they like.

Regards,
Thunor

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

#533 Post by 01micko »

thunor wrote: I've placed and will place a note atop examples about the version required and how to deal with the possibility of a "gtkdialog" name conflict on Puppy Linux :) Other than that, the binary renaming on Puppy doesn't involve me.
Come on 8-bit! We all know this is a dev thread :) (no offence intended)

Gtkdialog is an entire Linux (Unix, BSD too I guess) thing, and as a matter of fact I did a checkout of r10 the other day on Mageia to test a script I produced. No problem.

Code: Select all

#hack for puppylinux
if [ "$(which gtkdialog)" = "" ]; then GTKDIALOG="gtkdialog3"
 else  GTKDIALOG="gtkdialog"
fi
If I make a script meant to be "cross linux" (to coin a phrase :wink: ) I shove that some where near the start.

###

thunor, that tree example you gave should go in the official examples. works well here.
Puppy Linux Blog - contact me for access

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

#534 Post by thunor »

Hi zigbert

I've added a feauture request for your issues.

Regards,
Thunor
Last edited by thunor on Thu 23 Jun 2011, 10:24, edited 1 time in total.

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

#535 Post by 8-bit »

Ok to development.
So I will try to get back on track with this.
In /usr/share/doc/gtkdialog3 there is a short example program called 07.02-list_actions.
It is supposed to let one choose an item in a list and perform an action using it.
But it does not work right and could use some investigation.

Those writing scripts have avoided it because for some reason, it uses lots of processor time and one has to kill the script to exit.

When I first ran that example script, I thought since it was included, it should work.

If this is not a constructive back-on-track suggestion, I will just test scripts and try to keep up with changes to gtkdialog.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#536 Post by Dougal »

Folks, I've started a thread for gtkdialog development. Better use that.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

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

#537 Post by zigbert »

8-bit wrote:Ok to development.
So I will try to get back on track with this.
In /usr/share/doc/gtkdialog3 there is a short example program called 07.02-list_actions.
It is supposed to let one choose an item in a list and perform an action using it.
But it does not work right and could use some investigation.

Those writing scripts have avoided it because for some reason, it uses lots of processor time and one has to kill the script to exit.

When I first ran that example script, I thought since it was included, it should work.

If this is not a constructive back-on-track suggestion, I will just test scripts and try to keep up with changes to gtkdialog.
I think the <tree> widget will cover all of the <list> functions now that thunor has added the selection-mode option.


Sigmund

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

#538 Post by 01micko »

sc0ttman wrote: I don't want to nag about new widgets or heavy new features.
I would like to see a very high priority put into making backwards compatibility 100% stable..

For example, the IPConfig tool breaks (in Wary, I think) when the new gtkdialog is used, apparently...
Hi sc0ttman

if you used the exec I posted then it did break some stuff due to being compiled in a later puppy version. I recompiled in 431 and it seems solid now. You'll find it hidden in the games section :wink: .
Puppy Linux Blog - contact me for access

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

#539 Post by disciple »

sc0ttman wrote:
zigbert wrote:sc0ttman
What is wrong with using yad, bacon or xdialog?
Nothing, I wasn't saying people should avoid them - I love Xdialog.. Yad is nice too.. Haven't tried bacon, but I bet it's also nice.. But, for example, Yad requires a fairly new GTK, so GTK Dialog will work on systems where Yad does not..

I just think maybe we could ask others, who prefer Yad, what they think is missing in GTK-Dialog ...
The guys at Slitaz mention a couple of things they prefer about Yad at http://hg.slitaz.org/slitaz-dev-tools/r ... yad/README. I guess if you look around you'll probably find they had a discussion somewhere where more were mentioned.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

#540 Post by disciple »

BTW, Great work thunor!
Thanks
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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.

Post Reply