gtkdialog window/tree icon questions

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

gtkdialog window/tree icon questions

#1 Post by step »

The following three examples illustrate several problems I'm having with gtkdialog icons in the window widget on Fatdog64 701:
1. Why is icon gtk-yes shown properly in the title bar but icon gtk-open isn't? Many other stock icons aren't shown in the same way...
2. Is it possible to show a window icon by specifying its full path?
The same issues and questions extend to the tree widget using <tree icon-name="..."> for a column default icon or <item icon-name="..."> for an item icon.
Finally, googlecode gtkdialog doc says that a stock icon should be specified with stock-id="gtk-yes" rather than icon-name="gtk-yes" as in my first example below, but stock-id produces no icon here (Fatdog64).

Code: Select all

# echo '<window icon-name="gtk-yes"><hbox><button ok></button></hbox></window>' | gtkdialog -c -s
EXIT="OK"
# echo '<window icon-name="gtk-open"><hbox><button ok></button></hbox></window>' | gtkdialog -c -s
EXIT="OK"
# echo '<window icon-name="/usr/share/icons/hicolor/16x16/apps/geany.png"><hbox><button ok></button></hbox></window>' | gtkdialog -c -s
EXIT="OK"
The first example above displays a green dot icon; the other two examples display a generic (broken/missing) icon.
Last edited by step on Sun 24 May 2015, 20:53, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

step wrote:1. Why is icon gtk-yes shown properly in the title bar but icon gtk-close isn't? Many other stock icons aren't shown in the same way...
There's something wrong with GTK in Fatdog. I have no idea why's that...
The workaround is to use the new (GTK3) naming scheme, e.g. instead of gtk-close use window-close.

Code: Select all

echo '<window icon-name="window-close"><hbox><button ok></button></hbox></window>' | gtkdialog -c -s
Here you can find old->new names.
Btw, new names won't work in any other widgets, only in titlebar.

step wrote:2. Is it possible to show a window icon by specifying its full path?
Yep, it is:

Code: Select all

echo '<window image-name="/usr/share/icons/hicolor/16x16/apps/geany.png"><hbox><button ok></button></hbox></window>' | gtkdialog -c -s 
step wrote:The same issues and questions extend to the tree widget using <tree icon-name="..."> for a column default icon or <item icon-name="..."> for an item icon.
For stock icons, use stock-id:

Code: Select all

echo '<tree><item stock-id="gtk-close">test</item></tree>' | gtkdialog -s
and for "external" images icon-name, but keep in mind that in the this case you mustn't provide full path to the icon nor its extension; only its name alone.
And the icon needs to be in /usr/share/pixmaps or /usr/share/icons/*, e.g.:

Code: Select all

echo '<tree><item icon-name="abiword">good</item><item icon-name="/usr/share/icons/hicolor/48x48/apps/abiword.png">wrong</item></tree>' | gtkdialog -s
I didn't find a way to use full paths...

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#3 Post by step »

Thanks for the links. On Fatdog some new names work and some don't, so it's a mixed bag. Here's what I found for my use:
DON'T WORK / WORK
gtk-about help-about
preferences-system gtk-preferences
gtk-open document-open
gtk-directory folder
gtk-edit edit-clear *

* gtk-edit was deprecated with no substitute, so I use edit-clear, a not-so-close match, but hey!
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#4 Post by SFR »

Step, I found a real fix for this, see here.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#5 Post by step »

SFR wrote:Step, I found a real fix for this, see here.
I saw it, thanks. I replied in that thread
Incidentally, I compiled the list of new names into a dialog. Icon tooltips show the old/new names.
Attachments
s-gtk-stock-icons2.tar.gz
(1.88 KiB) Downloaded 303 times
xscreenshot00000.png
(131.49 KiB) Downloaded 1374 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

Post Reply