Class: Gtk::Style

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#apply_default_background(cr, window, state_type, x, y, width, height) ⇒ nil

Parameters:

  • cr (cairo::Context)
  • window (Gdk::Window)
  • state_type (Gtk::StateType)
  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)

Returns:

  • (nil)

#attach(window) ⇒ Gtk::Style

Attaches a style to a window; this process allocates the colors and creates the GC’s for the style - it specializes it to a particular visual. The process may involve the creation of a new style if the style has already been attached to a window with a different style and visual.

Since this function may return a new object, you have to use it in the following way: ‘style = gtk_style_attach (style, window)`

Parameters:

Returns:

  • (Gtk::Style)

    Either style, or a newly-created Gtk::Style. If the style is newly created, the style parameter will be unref’ed, and the new style will have a reference count belonging to the caller.

#contextGtk::StyleContext

Returns context.

Returns:

#context=(context) ⇒ Gtk::StyleContext

Parameters:

Returns:

#copyGtk::Style

Creates a copy of the passed in Gtk::Style object.

Returns:

#detachnil

Detaches a style from a window. If the style is not attached to any windows anymore, it is unrealized. See gtk_style_attach().

Returns:

  • (nil)

#get(widget_type, first_property_name, array) ⇒ nil

Gets the values of a multiple style properties for widget_type from style.

Parameters:

  • widget_type (GLib::Type)

    the #GType of a descendant of Gtk::Widget

  • first_property_name (String)

    the name of the first style property to get

  • array (Array)

    pairs of property names and locations to return the property values, starting with the location for first_property_name, terminated by nil.

Returns:

  • (nil)

#get_style_property(widget_type, property_name, value) ⇒ nil

Queries the value of a style property corresponding to a widget class is in the given style.

Parameters:

  • widget_type (GLib::Type)

    the #GType of a descendant of Gtk::Widget

  • property_name (String)

    the name of the style property to get

  • value (GObject::Value)

    a #GValue where the value of the property being queried will be stored

Returns:

  • (nil)

#get_valist(widget_type, first_property_name, var_args) ⇒ nil

Non-vararg variant of gtk_style_get(). Used primarily by language bindings.

Parameters:

  • widget_type (GLib::Type)

    the #GType of a descendant of Gtk::Widget

  • first_property_name (String)

    the name of the first style property to get

  • var_args (Gtk::va_list)

    a va_list of pairs of property names and locations to return the property values, starting with the location for first_property_name.

Returns:

  • (nil)

#has_contextTrueClass

Returns whether style has an associated Gtk::StyleContext.

Returns:

  • (TrueClass)

    true if style has a Gtk::StyleContext

#lookup_color(color_name, color) ⇒ TrueClass

Looks up color_name in the style’s logical color mappings, filling in color and returning true if found, otherwise returning false. Do not cache the found mapping, because it depends on the Gtk::Style and might change when a theme switch occurs.

Parameters:

  • color_name (String)

    the name of the logical color to look up

  • color (Gdk::Color)

    the Gdk::Color to fill in

Returns:

  • (TrueClass)

    true if the mapping was found.

#lookup_icon_set(stock_id) ⇒ Gtk::IconSet

Looks up stock_id in the icon factories associated with style and the default icon factory, returning an icon set if found, otherwise nil.

Parameters:

  • stock_id (String)

    an icon name

Returns:

  • (Gtk::IconSet)

    icon set of stock_id

#newGtk::Style

Creates a new Gtk::Style.

Returns:

#render_icon(source, direction, state, size, widget, detail) ⇒ GdkPixbuf::Pixbuf

Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.

Parameters:

  • source (Gtk::IconSource)

    the Gtk::IconSource specifying the icon to render

  • direction (Gtk::TextDirection)

    a text direction

  • state (Gtk::StateType)

    a state

  • size (Integer)

    the size to render the icon at (Gtk::IconSize). A size of ‘(GtkIconSize)-1` means render at the size of the source and don’t scale.

  • widget (Gtk::Widget)

    the widget

  • detail (String)

    a style detail

Returns:

#set_background(window, state_type) ⇒ nil

Sets the background of window to the background color or pixmap specified by style for the given state.

Parameters:

Returns:

  • (nil)