![]() ![]() Registers a built-in icon for icon theme lookups. Pixbuf ( GdkPixbuf.Pixbuf) – GdkPixbuf.Pixbuf that contains the image to use for icon_name Images can be registered for the same icon name at different sizes.) Size ( int) – the size in pixels at which to register the icon (different Icon_name ( str) – the name of the icon to register GError * error = NULL GtkIconTheme * icon_theme GdkPixbuf * pixbuf icon_theme = gtk_icon_theme_get_default () pixbuf = gtk_icon_theme_load_icon ( icon_theme, "my-icon-name", // icon name 48, // icon size 0, // flags & error ) if ( ! pixbuf ) classmethod add_builtin_icon ( icon_name, size, pixbuf ) ¶ Parameters So that the icon information is shared with other people YouĬan create new Gtk.IconTheme objects, but it’s much moreĮfficient to use the standard icon theme for the Gdk.Screen The Gtk.IconTheme object actsĪs a database of all the icons in the current theme. Or stock items, rather than directly, but looking up iconsĭirectly is also simple. In many cases, named themes are used indirectly, via Gtk.Image “gtk-stock-go-forward-ltr” and “gtk-stock-go-forward-rtl”.) Gtk.STOCK_GO_FORWARD uses the two themed icons More than one case is icons that depend on writing direction Out that internally stock images are generally defined in You want to use, use it, otherwise use a named icon. Multiple variants for different widget states or writingĪ good rule of thumb is that if there is a stock image for what ![]() To actions in the user interface, stock images may come in Stock images can only be loaded at the symbolic sizes definedīy the Gtk.IconSize enumeration, or by custom sizes definedīy (), while named icons are more flexibleīecause stock images are closely tied to stock items, and thus Named icons are easier to set up and thereforeĪre more useful for new icons that an application wants toĪdd, such as application icons or window icons. Stock images usually are used in conjunction with Named icons are similar to the deprecated ‘Stock Items ’,Īnd the distinction between the two may be a bit confusing. Should install their icons, but additional icon themes can be installedĪs operating system vendors and users choose. There is a fallback icon theme, named hicolor, where applications The operation of icon themes on Linux and Unix Providing a filename is to allow different icons to be usedĭepending on what “icon theme” is selectedīy the user. The main reason for using a name rather than simply Gtk.IconTheme provides a facility for looking up icons by nameĪnd size. Lookup_icon_for_scale (icon_name, size, scale, flags)Įmitted when the current icon theme is switched or GTK+ detects that a change has occurred in the contents of the current icon theme.Ĭlass Details ¶ class Gtk. Lookup_by_gicon_for_scale (icon, size, scale, flags) Load_surface (icon_name, size, scale, for_window, flags) Load_icon_for_scale (icon_name, size, scale, flags) G GObject.Object GObject.Object Gtk.IconTheme Gtk.IconTheme GObject.Object->Gtk.IconTheme SubclassesĪdd_builtin_icon (icon_name, size, pixbuf)Ĭhoose_icon_for_scale (icon_names, size, scale, flags)
0 Comments
Leave a Reply. |