class Gtk::CellRendererPixbuf

Overview

Renders a pixbuf in a cell

A Gtk::CellRendererPixbuf can be used to render an image in a cell. It allows to render either a given Gdk::Pixbuf (set via the Gtk::CellRendererPixbuf:pixbuf property) or a named icon (set via the Gtk::CellRendererPixbuf:icon-name property).

To support the tree view, Gtk::CellRendererPixbuf also supports rendering two alternative pixbufs, when the Gtk::CellRenderer:is-expander property is true. If the Gtk::CellRenderer:is-expanded property is true and the Gtk::CellRendererPixbuf:pixbuf-expander-open property is set to a pixbuf, it renders that pixbuf, if the Gtk::CellRenderer:is-expanded property is false and the Gtk::CellRendererPixbuf:pixbuf-expander-closed property is set to a pixbuf, it renders that one.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/cell_renderer_pixbuf.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Gtk::CellRenderer

==(other : self) ==, activate(event : Gdk::Event, widget : Gtk::Widget, path : String, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Bool activate, aligned_area(widget : Gtk::Widget, flags : Gtk::CellRendererState, cell_area : Gdk::Rectangle) : Gdk::Rectangle aligned_area, alignment : Nil alignment, cell_background=(value : String) : String
cell_background=(value : Nil) : Nil
cell_background=
, cell_background_rgba : Gdk::RGBA | Nil cell_background_rgba, cell_background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil cell_background_rgba=, cell_background_set=(value : Bool) : Bool cell_background_set=, cell_background_set? : Bool cell_background_set?, editing? : Bool editing?, editing_canceled_signal editing_canceled_signal, editing_started_signal editing_started_signal, fixed_size : Nil fixed_size, hash(hasher) hash, height : Int32 height, height=(value : Int32) : Int32 height=, is_activatable : Bool is_activatable, is_expanded : Bool is_expanded, is_expanded=(is_expanded : Bool) : Nil is_expanded=, is_expanded? : Bool is_expanded?, is_expander : Bool is_expander, is_expander=(is_expander : Bool) : Nil is_expander=, is_expander? : Bool is_expander?, mode : Gtk::CellRendererMode mode, mode=(value : Gtk::CellRendererMode) : Gtk::CellRendererMode mode=, padding : Nil padding, preferred_height(widget : Gtk::Widget) : Nil preferred_height, preferred_height_for_width(widget : Gtk::Widget, width : Int32) : Nil preferred_height_for_width, preferred_size(widget : Gtk::Widget) : Gtk::Requisition preferred_size, preferred_width(widget : Gtk::Widget) : Nil preferred_width, preferred_width_for_height(widget : Gtk::Widget, height : Int32) : Nil preferred_width_for_height, request_mode : Gtk::SizeRequestMode request_mode, sensitive : Bool sensitive, sensitive=(sensitive : Bool) : Nil sensitive=, sensitive? : Bool sensitive?, set_alignment(xalign : Float32, yalign : Float32) : Nil set_alignment, set_fixed_size(width : Int32, height : Int32) : Nil set_fixed_size, set_padding(xpad : Int32, ypad : Int32) : Nil set_padding, snapshot(snapshot : Gtk::Snapshot, widget : Gtk::Widget, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Nil snapshot, start_editing(event : Gdk::Event | Nil, widget : Gtk::Widget, path : String, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Gtk::CellEditable | Nil start_editing, state(widget : Gtk::Widget | Nil, cell_state : Gtk::CellRendererState) : Gtk::StateFlags state, stop_editing(canceled : Bool) : Nil stop_editing, visible : Bool visible, visible=(visible : Bool) : Nil visible=, visible? : Bool visible?, width : Int32 width, width=(value : Int32) : Int32 width=, xalign : Float32 xalign, xalign=(value : Float32) : Float32 xalign=, xpad : UInt32 xpad, xpad=(value : UInt32) : UInt32 xpad=, yalign : Float32 yalign, yalign=(value : Float32) : Float32 yalign=, ypad : UInt32 ypad, ypad=(value : UInt32) : UInt32 ypad=

Constructor methods inherited from class Gtk::CellRenderer

new
new(*, cell_background : String | Nil = nil, cell_background_rgba : Gdk::RGBA | Nil = nil, cell_background_set : Bool | Nil = nil, editing : Bool | Nil = nil, height : Int32 | Nil = nil, is_expanded : Bool | Nil = nil, is_expander : Bool | Nil = nil, mode : Gtk::CellRendererMode | Nil = nil, sensitive : Bool | Nil = nil, visible : Bool | Nil = nil, width : Int32 | Nil = nil, xalign : Float32 | Nil = nil, xpad : UInt32 | Nil = nil, yalign : Float32 | Nil = nil, ypad : UInt32 | Nil = nil)
new

Class methods inherited from class Gtk::CellRenderer

g_type : UInt64 g_type

Instance methods inherited from class GObject::InitiallyUnowned

==(other : self) ==, hash(hasher) hash

Constructor methods inherited from class GObject::InitiallyUnowned

new new

Class methods inherited from class GObject::InitiallyUnowned

g_type : UInt64 g_type

Instance methods inherited from class GObject::Object

==(other : self) ==, bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Macros inherited from class GObject::Object

previous_vfunc(*args) previous_vfunc, previous_vfunc!(*args) previous_vfunc!, signal(signature) signal

Constructor Detail

def self.new : self #

Creates a new Gtk::CellRendererPixbuf. Adjust rendering parameters using object properties. Object properties can be set globally (with g_object_set()). Also, with Gtk::TreeViewColumn, you can bind a property to a value in a Gtk::TreeModel. For example, you can bind the “pixbuf” property on the cell renderer to a pixbuf value in the model, thus rendering a different image in each row of the Gtk::TreeView.


[View source]
def self.new(*, cell_background : String | Nil = nil, cell_background_rgba : Gdk::RGBA | Nil = nil, cell_background_set : Bool | Nil = nil, editing : Bool | Nil = nil, gicon : Gio::Icon | Nil = nil, height : Int32 | Nil = nil, icon_name : String | Nil = nil, icon_size : Gtk::IconSize | Nil = nil, is_expanded : Bool | Nil = nil, is_expander : Bool | Nil = nil, mode : Gtk::CellRendererMode | Nil = nil, pixbuf : GdkPixbuf::Pixbuf | Nil = nil, pixbuf_expander_closed : GdkPixbuf::Pixbuf | Nil = nil, pixbuf_expander_open : GdkPixbuf::Pixbuf | Nil = nil, sensitive : Bool | Nil = nil, texture : Gdk::Texture | Nil = nil, visible : Bool | Nil = nil, width : Int32 | Nil = nil, xalign : Float32 | Nil = nil, xpad : UInt32 | Nil = nil, yalign : Float32 | Nil = nil, ypad : UInt32 | Nil = nil) #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def gicon : Gio::Icon | Nil #

[View source]
def gicon=(value : Gio::Icon | Nil) : Gio::Icon | Nil #

[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def icon_name : String #

[View source]
def icon_name=(value : String) : String #

[View source]
def icon_name=(value : Nil) : Nil #

Set #icon_name property to nil.


[View source]
def icon_name? : String | Nil #

Same as #icon_name, but can return nil.


[View source]
def icon_size : Gtk::IconSize #

[View source]
def icon_size=(value : Gtk::IconSize) : Gtk::IconSize #

[View source]
def pixbuf=(value : GdkPixbuf::Pixbuf | Nil) : GdkPixbuf::Pixbuf | Nil #

[View source]
def pixbuf_expander_closed : GdkPixbuf::Pixbuf | Nil #

[View source]
def pixbuf_expander_closed=(value : GdkPixbuf::Pixbuf | Nil) : GdkPixbuf::Pixbuf | Nil #

[View source]
def pixbuf_expander_open : GdkPixbuf::Pixbuf | Nil #

[View source]
def pixbuf_expander_open=(value : GdkPixbuf::Pixbuf | Nil) : GdkPixbuf::Pixbuf | Nil #

[View source]
def texture : Gdk::Texture | Nil #

[View source]
def texture=(value : Gdk::Texture | Nil) : Gdk::Texture | Nil #

[View source]