1.100 <GtkIconPaintable>

Class: <GtkIconPaintable>

It derives from <GObject>.

Contains information found when looking up an icon in <GtkIconTheme> or loading it from a file.

<GtkIconPaintable> implements <GdkPaintable> and <GtkSymbolicPaintable>.

Properties

Property: icon-paintable:file self

The file representing the icon, if any.

Its value is a <GFile>, or #f.

It can only be set when the object is made, with #:file.

Property: icon-paintable:icon-name self

The icon name that was chosen during lookup.

Its value is a string, or #f.

It can only be set when the object is made, with #:icon-name.

Property: icon-paintable:is-symbolic self

Whether the icon is symbolic or not.

Its value is a boolean.

Set it with (set! (icon-paintable:is-symbolic self) value).

Property: icon-paintable:scale self

Its value is a 32-bit integer.

Set it with (set! (icon-paintable:scale self) value).

Property: icon-paintable:size self

Its value is a 32-bit integer.

Set it with (set! (icon-paintable:size self) value).

Procedures

Method: icon-paintable:get-file self ⇒ %return
Method: get-file self ⇒ %return

Gets the <GFile> that was used to load the icon.

Returns #f if the icon was not loaded from a file.

self

Passed: a <GtkIconPaintable>.

a <GtkIconPaintable>

%return

Returned: a <GFile>, or #f.

the <GFile> for the icon

Method: icon-paintable:get-icon-name self ⇒ %return
Method: get-icon-name self ⇒ %return

Get the icon name being used for this icon.

When an icon looked up in the icon theme was not available, the icon theme may use fallback icons - either those specified to icon-theme:lookup-icon or the always-available "image-missing". The icon chosen is returned by this function.

If the icon was created without an icon theme, this function returns #f.

self

Passed: a <GtkIconPaintable>.

a <GtkIconPaintable>

%return

Returned: a file name, as a string, or #f.

the themed icon-name for the icon, or #f if its not a themed icon.

Method: icon-paintable:is-symbolic? self ⇒ %return
Method: is-symbolic? self ⇒ %return

Checks if the icon is symbolic or not.

This currently uses only the file name and not the file contents for determining this. This behaviour may change in the future.

self

Passed: a <GtkIconPaintable>.

an icon paintable

%return

Returned: a boolean.

true if the icon is symbolic, false otherwise

Procedure: icon-paintable:new-for-file file size scale ⇒ %return

Creates a <GtkIconPaintable> for a file with a given size and scale.

The icon can then be rendered by using it as a <GdkPaintable>.

file

Passed: a <GFile>.

a <GFile>

size

Passed: a 32-bit integer.

desired icon size, in application pixels

scale

Passed: a 32-bit integer.

the desired scale

%return

Returned: a <GtkIconPaintable>.

a <GtkIconPaintable> containing for the icon. Unref with object:unref