IconInfo
Object Hierarchy:
Gtk.IconInfo
Gtk.IconInfo
Gtk.IconInfo
GLib.Object
GLib.Object
GLib.Object->Gtk.IconInfo
Description:
[
CCode ( type_id =
"gtk_icon_info_get_type ()" ) ]
[
Version ( since =
"3.8" ) ]
public sealed class IconInfo :
Object
Contains information found when looking up an icon in an icon theme.
Example: IconInfo:
public class Application : Gtk.Window { public Application () { // Prepare Gtk.Window: this .title = "My Gtk.IconInfo" ; this .window_position = Gtk.WindowPosition.CENTER; this .destroy.connect (Gtk.main_quit); // Add a button Gtk.Button button = new Gtk.Button (); this .add (button); // Get the icon: Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default (); try { Gtk.IconInfo? icon_info = icon_theme.lookup_icon ("go-home" , 48 , 0 ); assert (icon_info != null ); Gdk.Pixbuf pixbuf = icon_info.load_icon (); button.image = new Gtk.Image.from_pixbuf (pixbuf); } catch (Error e) { warning (e.message); } } public static int main (string [] args) { Gtk.init (ref args); Application app = new Application (); app.show_all (); Gtk.main (); return 0 ; } }
valac --pkg gtk+-3.0 Gtk.IconInfo.vala
Content:
Creation methods:
Methods:
public bool get_attach_points (out Point [] points)
This function is deprecated and always returns
false .
public int get_base_scale ()
Gets the base scale for the icon.
public int get_base_size ()
Gets the base size for the icon.
public unowned Pixbuf ? get_builtin_pixbuf ()
Gets the built-in image for this icon, if any.
public unowned string get_display_name ()
This function is deprecated and always returns
null .
public bool get_embedded_rect (out Rectangle rectangle)
This function is deprecated and always returns
false .
public unowned string ? get_filename ()
Gets the filename for the icon.
public bool is_symbolic ()
Checks if the icon is symbolic or not.
public Pixbuf load_icon () throws Error
Renders an icon previously looked up in an icon theme using
lookup_icon ; the size will be based on the size passed to
lookup_icon .
public async Pixbuf load_icon_async (Cancellable ? cancellable = null ) throws Error
Asynchronously load, render and scale an icon previously looked up from the
icon theme using lookup_icon .
public Surface load_surface (Window ? for_window) throws Error
Renders an icon previously looked up in an icon theme using
lookup_icon ; the size will be based on the size passed to
lookup_icon .
public Pixbuf load_symbolic (RGBA fg, RGBA ? success_color = null , RGBA ? warning_color = null , RGBA ? error_color = null , out bool was_symbolic = null ) throws Error
Loads an icon, modifying it to match the system colours for the foreground,
success, warning and error colors provided.
public async Pixbuf load_symbolic_async (RGBA fg, RGBA ? success_color = null , RGBA ? warning_color = null , RGBA ? error_color = null , Cancellable ? cancellable = null , out bool was_symbolic = null ) throws Error
Asynchronously load, render and scale a symbolic icon previously looked up
from the icon theme using lookup_icon .
public Pixbuf load_symbolic_for_context (StyleContext context, out bool was_symbolic = null ) throws Error
Loads an icon, modifying it to match the system colors for the foreground,
success, warning and error colors provided.
public async Pixbuf load_symbolic_for_context_async (StyleContext context, Cancellable ? cancellable = null , out bool was_symbolic = null ) throws Error
Asynchronously load, render and scale a symbolic icon previously looked up
from the icon theme using lookup_icon .
public Pixbuf load_symbolic_for_style (Style style, StateType state, out bool was_symbolic = null ) throws Error
Loads an icon, modifying it to match the system colours for the foreground,
success, warning and error colors provided.
public void set_raw_coordinates (bool raw_coordinates)
Sets whether the coordinates returned by
get_embedded_rect and
get_attach_points should be returned in their original form as
specified in the icon theme, instead of scaled appropriately for the pixbuf returned by
load_icon .
Inherited Members:
All known members inherited from class GLib.Object