[Gambas-user] using icons from system theme without specifiying full path

Benoit Minisini gambas at ...1...
Tue Dec 2 15:06:46 CET 2008


On dimanche 30 novembre 2008, Joshua Higgins wrote:
> well.... I'm making an application launcher. It reads all the .desktop
> files from under /usr/share/applications and after loads of splitting adds
> them to a ListView.
>
> .desktop file layed out as follows:
>
> [Desktop Entry]
> Type=Application
> Name=Inkscape
> Comment=Vector Graphics Editor
> Exec=inkscape
> Icon=inkscape.png
> Categories=GNOME;Utility;
>
> The problem I'm having is that the icons are described as they are in the
> theme, i.e. just the file name, not by the path, and I'm struggling to find
> a reliable way to resolve this back to the path to the icon, which I can
> then load into Gambas.
>

Gambas internally uses its own algorithm to get desktop icons from theme, 
because it needs to get the current icon theme first, which depends on the 
current desktop being used. Then it use a desktop-dependent method to get the 
path of the icon theme.

But the real algorithm you must follow is described by a freedesktop standard 
at:

http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

Regards,

-- 
Benoit Minisini




More information about the User mailing list