Class (GI Struct)

Gtk-3.0GtkIconSource

Index

Constructors

Properties

$gtype: GType<IconSource>

Methods

  • Frees a dynamically-allocated icon source, along with its filename, size, and pixbuf fields if those are not null.

    Returns void

  • Gets the value set by gtk_icon_source_set_direction_wildcarded().

    Returns boolean

    true if this icon source is a base for any text direction variant

  • Retrieves the source filename, or null if none is set. The filename is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

    Returns string

    image filename. This string must not be modified or freed.

  • Retrieves the source icon name, or null if none is set. The icon_name is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

    Returns string

    icon name. This string must not be modified or freed.

  • Retrieves the source pixbuf, or null if none is set. In addition, if a filename source is in use, this function in some cases will return the pixbuf from loaded from the filename. This is, for example, true for the GtkIconSource passed to the Gtk.Style render_icon() virtual function. The reference count on the pixbuf is not incremented.

    Returns GdkPixbuf.Pixbuf

    source pixbuf

  • Obtains the icon size this source applies to. The return value is only useful/meaningful if the icon size is not wildcarded.

    Returns number

    icon size (Gtk.IconSize) this source matches.

  • Gets the value set by gtk_icon_source_set_size_wildcarded().

    Returns boolean

    true if this icon source is a base for any icon size variant

  • Gets the value set by gtk_icon_source_set_state_wildcarded().

    Returns boolean

    true if this icon source is a base for any widget state variant

  • Sets the text direction this icon source is intended to be used with.

    Setting the text direction on an icon source makes no difference if the text direction is wildcarded. Therefore, you should usually call gtk_icon_source_set_direction_wildcarded() to un-wildcard it in addition to calling this function.

    Parameters

    Returns void

  • If the text direction is wildcarded, this source can be used as the base image for an icon in any Gtk.TextDirection. If the text direction is not wildcarded, then the text direction the icon source applies to should be set with gtk_icon_source_set_direction(), and the icon source will only be used with that text direction.

    Gtk.IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

    Parameters

    • setting: boolean

      true to wildcard the text direction

    Returns void

  • Sets the name of an image file to use as a base image when creating icon variants for Gtk.IconSet. The filename must be absolute.

    Parameters

    • filename: string

      image file to use

    Returns void

  • Sets the name of an icon to look up in the current icon theme to use as a base image when creating icon variants for Gtk.IconSet.

    Parameters

    • Optionalicon_name: string

      name of icon to use

    Returns void

  • Sets the icon size this icon source is intended to be used with.

    Setting the icon size on an icon source makes no difference if the size is wildcarded. Therefore, you should usually call gtk_icon_source_set_size_wildcarded() to un-wildcard it in addition to calling this function.

    Parameters

    • size: number

      icon size (Gtk.IconSize) this source applies to

    Returns void

  • If the icon size is wildcarded, this source can be used as the base image for an icon of any size. If the size is not wildcarded, then the size the source applies to should be set with gtk_icon_source_set_size() and the icon source will only be used with that specific size.

    Gtk.IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

    Gtk.IconSet will normally scale wildcarded source images to produce an appropriate icon at a given size, but will not change the size of source images that match exactly.

    Parameters

    • setting: boolean

      true to wildcard the widget state

    Returns void

  • Sets the widget state this icon source is intended to be used with.

    Setting the widget state on an icon source makes no difference if the state is wildcarded. Therefore, you should usually call gtk_icon_source_set_state_wildcarded() to un-wildcard it in addition to calling this function.

    Parameters

    Returns void

  • If the widget state is wildcarded, this source can be used as the base image for an icon in any Gtk.StateType. If the widget state is not wildcarded, then the state the source applies to should be set with gtk_icon_source_set_state() and the icon source will only be used with that specific state.

    Gtk.IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

    Gtk.IconSet will normally transform wildcarded source images to produce an appropriate icon for a given state, for example lightening an image on prelight, but will not modify source images that match exactly.

    Parameters

    • setting: boolean

      true to wildcard the widget state

    Returns void