[Gambas-devel] GTK 050214A

Benoit Minisini gambas at ...1...
Tue Feb 15 12:45:20 CET 2005


On Monday 14 February 2005 20:53, Daniel Campos wrote:
> Hi:
>
> Here's gb.gtk 050214. This version includes the Slider and ScrollBar
> controls
> that will be moved also from gb.qt.ext to gb.qt in the next developement
> version.
>
> This version also includes the first GTK+ extension: gb.gtk.stock, that
> provides access
> to the Stock (Predefined) and System icons when using GTK+. It would be
> nice if some similar class
> could be added to gb.qt or gb.qt.kde, as it allows to make the
> application look like a native
> GTK+ or KDE application
>
> GNOME just uses the Stock items from GTK+, but a pure GTK+(non GNOME
> related) application
> written in C, can also use these Stock items, so it is not
> gb.gtk.gnome.stock but gb.gtk.stock .
>
> These icons change when the user changes the theme, so, in a GNOME
> environment the Gambas
> application looks coherent with the rest of applications. (see attached
> screenshot)
>
> If you want to compile that new component, you need to modify at least
> configure.in at gambas sources
> folder,prior to "reconf" and "configure":
>
> ....
> src/lib/qt/kde/Makefile \
> src/lib/qt/kde/html/Makefile \
> src/lib/gtk/Makefile \
> src/lib/gtk/stock/Makefile \     <--- Add this line
> src/lib/db/Makefile \
> src/lib/db/mysql/Makefile \
> ...
>
>
> Regards,
>
> D. Campos

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 ?

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list