W Wrapl, The Programming Language

Libraries:Gtk:Gtk:IconFactory

Types

T

Inherits from:

Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



LookupDefault(stock_id @ Std.String.T) : Gtk.Gtk.IconSet.T

Looks for an icon in the list of default icon factories. For display to the user, you should use Gtk.Gtk.Style.LookupIconSet on the Gtk.Gtk.Style.T for the widget that will display the icon, instead of using this function directly, so that themes are taken into account.

stock_id an icon name
Returns a Gtk.Gtk.IconSet.T, or NULL. [transfer none]


New() : Gtk.Gtk.IconFactory.T

Creates a new T. An icon factory manages a collection of Gtk.Gtk.IconSet.Ts; a Gtk.Gtk.IconSet.T manages a set of variants of a particular icon (i.e. a Gtk.Gtk.IconSet.T contains variants for different sizes and widget states). Icons in an icon factory are named by a stock ID, which is a simple string identifying the icon. Each Gtk.Gtk.Style.T has a list of Ts derived from the current theme; those icon factories are consulted first when searching for an icon. If the theme doesn't set a particular icon, GTK+ looks for the icon in a list of default icon factories, maintained by AddDefault and RemoveDefault. Applications with icons should add a default icon factory with their icons, which will allow themes to override the icons for the application.

Returns a new T


Methods

:Add(self @ T, stock_id @ Std.String.T, icon_set @ Gtk.Gtk.IconSet.T) : Std.Object.T

Adds the given icon_set to the icon factory, under the name stock_id. stock_id should be namespaced for your application, e.g. "myapp-whatever-icon". Normally applications create a T, then add it to the list of default factories with AddDefault. Then they pass the stock_id to widgets such as Gtk.Gtk.Image.T to display the icon. Themes can provide an icon with the same name (such as "myapp-whatever-icon") to override your application's default icons. If an icon already existed in factory for stock_id, it is unreferenced and replaced with the new icon_set.

factory a T
stock_id icon name
icon_set icon set


:AddDefault(self @ T) : Std.Object.T

Adds an icon factory to the list of icon factories searched by Gtk.Gtk.Style.LookupIconSet. This means that, for example, gtk_image_new_from_stock() will be able to find icons in factory. There will normally be an icon factory added for each library or application that comes with icons. The default icon factories can be overridden by themes.

factory a T


:Lookup(self @ T, stock_id @ Std.String.T) : Gtk.Gtk.IconSet.T

Looks up stock_id in the icon factory, returning an icon set if found, otherwise NULL. For display to the user, you should use Gtk.Gtk.Style.LookupIconSet on the Gtk.Gtk.Style.T for the widget that will display the icon, instead of using this function directly, so that themes are taken into account.

factory a T
stock_id an icon name
Returns icon set of stock_id. [transfer none]


:RemoveDefault(self @ T) : Std.Object.T

Removes an icon factory from the list of default icon factories. Not normally used; you might use it for a library that can be unloaded or shut down.

factory a T previously added with AddDefault