[Gambas-devel] GTK 050214A

Daniel Campos daniel.campos at ...103...
Tue Feb 15 15:51:40 CET 2005


>
>Instead of a Stock class, I think a better solution would be extending the 
>'_get' method of the Picture class with a syntax that means "stock icon".
>
>This way, the IDE will be able to use them.
>
>I suggest directly using Picture["icon_name"]. First search in the project 
>like Picture._get do. Otherwise, use stock icons.
>
>In GTK, Picture["Apply"] => Stock[Stock.Apply, Stock.Button]
>
>The KDE component will just have to reimplement Picture._get, with help from 
>the QT component I think.
>
>This way, no details about internal stock objects implementation is 
>exposed :-)
>
>What do you think about that ?
>  
>
Yes, it's a good idea as seems more transparent for the programmer, however
I think this could be:

Picture[Path As String, [StockSize As Integer] ]

Picture["Apply"] --> Searchs the icon embeed in the executable, and in 
the file system.

Picture["Apply",StockSize.Button] --> Searchs the icon in the Stock 
items, and,
if not found, in the "Named Icons" (this is the second class provided in 
gb.gtk.stock,
and they are icons placed in some predefined paths, for example the 
icons that are
shown when you want to add a new desktop icon in kde or gnome 
"/usr/share/pixmaps...").

It is important to keep the second parameter, as it defines the size of 
the icon you want to get,
as there are low resolution icons (for little elements like menu items), 
high resolution icons
(for large buttons, for example), and these symbolic sizes can change if 
the user uses special
themes: for example high contrast and big icons for people with problems 
in the eyes (more
than me 8-))), or children.

Regards,

D. Campos






More information about the Devel mailing list