Gjsify LogoGjsify Logo

Hierarchy

  • IconSet

Index

Constructors

  • Creates a new #GtkIconSet. A #GtkIconSet represents a single icon in various sizes and widget states. It can provide a #GdkPixbuf for a given size and state on request, and automatically caches some of the rendered #GdkPixbuf objects.

    Normally you would use gtk_widget_render_icon() instead of using #GtkIconSet directly. The one case where you'd use #GtkIconSet is to create application-specific icon sets to place in a #GtkIconFactory.

    Returns Gtk.IconSet

Properties

name: string

Methods

  • Icon sets have a list of #GtkIconSource, which they use as base icons for rendering icons in different states and sizes. Icons are scaled, made to look insensitive, etc. in gtk_icon_set_render_icon(), but #GtkIconSet needs base images to work with. The base images and when to use them are described by a #GtkIconSource.

    This function copies source, so you can reuse the same source immediately without affecting the icon set.

    An example of when you'd use this function: a web browser's "Back to Previous Page" icon might point in a different direction in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon, and you might add a separate source for each one.

    You should nearly always add a "default" icon source with all fields wildcarded, which will be used as a fallback if no more specific source matches. #GtkIconSet always prefers more specific icon sources to more generic icon sources. The order in which you add the sources to the icon set does not matter.

    gtk_icon_set_new_from_pixbuf() creates a new icon set with a default icon source based on the given pixbuf.

    Parameters

    Returns void

  • get_sizes(): number[]
  • Obtains a list of icon sizes this icon set can render. The returned array must be freed with g_free().

    Returns number[]

  • Renders an icon using gtk_style_render_icon(). In most cases, gtk_widget_render_icon() is better, since it automatically provides most of the arguments from the current widget settings. This function never returns %NULL; if the icon can't be rendered (perhaps because an image file fails to load), a default "missing image" icon will be returned instead.

    Parameters

    • style: Gtk.Style

      a #GtkStyle associated with widget, or %NULL

    • direction: Gtk.TextDirection

      text direction

    • state: Gtk.StateType

      widget state

    • size: number

      icon size. A size of (GtkIconSize)-1 means render at the size of the source and don't scale.

    • widget: Gtk.Widget

      widget that will display the icon, or %NULL. The only use that is typically made of this is to determine the appropriate #GdkScreen.

    • detail: string

      detail to pass to the theme engine, or %NULL. Note that passing a detail of anything but %NULL will disable caching.

    Returns Pixbuf

  • unref(): void
  • Decrements the reference count on icon_set, and frees memory if the reference count reaches 0.

    Returns void

  • Creates a new #GtkIconSet. A #GtkIconSet represents a single icon in various sizes and widget states. It can provide a #GdkPixbuf for a given size and state on request, and automatically caches some of the rendered #GdkPixbuf objects.

    Normally you would use gtk_widget_render_icon() instead of using #GtkIconSet directly. The one case where you'd use #GtkIconSet is to create application-specific icon sets to place in a #GtkIconFactory.

    Returns Gtk.IconSet

  • Creates a new #GtkIconSet with pixbuf as the default/fallback source image. If you don't add any additional #GtkIconSource to the icon set, all variants of the icon will be created from pixbuf, using scaling, pixelation, etc. as required to adjust the icon size or make the icon look insensitive/prelighted.

    Parameters

    Returns Gtk.IconSet

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method