Re: introspection and icons
- From: Tim Janik <timj gtk org>
- To: Martijn van Beers <martijn earthling net>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>,Stephen White <spwhite chariot net au>
- Subject: Re: introspection and icons
- Date: Sun, 6 Aug 2000 19:29:20 +0200 (CEST)
On Sun, 6 Aug 2000, Stephen White wrote:
> On Sat, 5 Aug 2000, Martijn van Beers wrote:
>
> > No need to make the API very elaborate I think, so just a function
> > to get the path where the icons are, and one to get an array of
> > widget names. With that information, and the fact that all the
> > icons are in a standard image file format (.png, .xpm?) the
> > builder can get an icon for each widget:
> >
> > G_MODULE_EXPORT gchar *gtk_get_widget_icon_path (void);
> > G_MODULE_EXPORT gchar **gtk_get_widget_list (void);
gtk_get_widget_list() doesn't actually help any, since widget types
are only known to the type system after gtk_<WIDGET>_get_type() has
been called.
> There's function calls like:
>
> gtk_vbox_get_type()
> gtk_button_get_type()
> gtk_window_get_type()
that is to dynamically announce the different widget types to the type
system, every function does something widely different from the others
by registering the implementation of a new widget type.
> which already exist. To fit into the existing scheme, the icons could
> be layered in with the following calls:
>
> gtk_vbox_get_icon()
> gtk_button_get_icon()
> gtk_window_get_icon()
while those functions all do pretty much the same thing, your argument
would suggest having:
gtk_vboc_show()
gtk_button_show()
gtk_window_show()
as well ;)
> It makes writing the icon support a little more difficult, but the Gtk
> API would be more consistent overall.
>
> The downside of this is being unable to grab any kind of icon, because
> the function name is hard-coded. This problem also applies to grabbing
> any kind of type, so perhaps this could be cleaned up at the same time.
do we want widget's to include icons directly in the source,
e.g. with inlined pixbuf, so a call like gtk_widget_get_icon() could
return a pixbuf?
i'm pretty sure the answer here is no, since that would bloat gtk's .so
for the common case, while those icons are really only needed for ui
builder apps/libs.
with pixbuf available in gtk, i think we're better off, providing the
icons in a standard format, i.e. png, and provide
gchar* gtk_make_widget_icon_path (GType widget_type);
e.g. for GTK_TYPE_BUTTON, this function would amount to
g_strconcat (${pkgdatadir}, "/", g_type_name (GTK_TYPE_BUTTON), ".png", NULL);
(pkgdatadir being /usr/local/share/gtk+/ for the default prefix)
the various widget types can be retrived generically by querying the
child types of GTK_TYPE_WIDGET recursively.
>
> --
> spwhite@chariot.net.au
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]