---
name: "Gtk2::Style"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::Style"
---

# Gtk2::Style(3pm)

wrapper for GtkStyle

## NAME

Gtk2::Style - wrapper for GtkStyle

## HIERARCHY

```
  Glib::Object
  +----Gtk2::Style
```

## METHODS

### style = Gtk2::Style-\>new

### $style-\>apply\_default\_background ($window, $set\_bg, $state\_type, $area, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Window)

- •

  `$set_bg` (boolean)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### style = $style-\>attach ($window)

- •

  `$window` (Gtk2::Gdk::Window)

### boolean = $style-\>attached

### $style-\>set\_background ($window, $state\_type)

- •

  `$window` (Gtk2::Gdk::Window)

- •

  `$state_type` (Gtk2::StateType)

### color = $style-\>base ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>base\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### color = $style-\>bg ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>bg\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### pixmap = $style-\>bg\_pixmap ($state, $pixmap=undef)

- •

  `$state` (Gtk2::StateType)

- •

  `$pixmap` (Gtk2::Gdk::Pixmap or undef)

### scalar = $style-\>black

### scalar = $style-\>black\_gc

### style = $style-\>copy

### color = $style-\>dark ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>dark\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### $style-\>detach

### Gtk2-\>draw\_insertion\_cursor ($widget, $drawable, $area, $location, $is\_primary, $direction, $draw\_arrow)

- •

  `$widget` (Gtk2::Widget)

- •

  `$drawable` (Gtk2::Gdk::Drawable)

- •

  `$area` (Gtk2::Gdk::Rectangle)

- •

  `$location` (Gtk2::Gdk::Rectangle)

- •

  `$is_primary` (boolean)

- •

  `$direction` (Gtk2::TextDirection)

- •

  `$draw_arrow` (boolean)

Since: gtk+ 2.4

### color = $style-\>fg ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>fg\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### scalar = $style-\>font\_desc

### list = $style-\>get (widget\_package, ...)

### list = $style-\>get\_style\_property (widget\_package, ...)

- •

  `$widget_package` (string) widget package name (ex: 'Gtk2::TreeView')

- •

  ... (list) list of property names

Fetch and return the values for the style properties named in *...* for a widget of type *widget\_package*.  *get* is an alias for *get\_style\_property*.

```
    my $size = $style->get_style_property ("expander-size");
```

**Note**: The *get* method shadows *Glib::Object::get* (see "get and set" in Glib::Object).  This shouldn't be a problem since *Gtk2::Style* defines no properties (as of gtk+ 2.16).  If you have a class that's derived from Gtk2::Style and adds a property or if a new version of gtk+ adds a property to *Gtk2::Style* then the property can be accessed with *get\_property*.

Since: gtk+ 2.16

### color = $style-\>light ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>light\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### color = $style-\>lookup\_color ($color\_name)

- •

  `$color_name` (string)

Since: gtk+ 2.10

### iconset = $style-\>lookup\_icon\_set ($stock\_id)

- •

  `$stock_id` (string)

### color = $style-\>mid ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>mid\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### $style-\>paint\_arrow ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $arrow\_type, $fill, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$arrow_type` (Gtk2::ArrowType)

- •

  `$fill` (boolean)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_box ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_box\_gap ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height, $gap\_side, $gap\_x, $gap\_width)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

- •

  `$gap_side` (Gtk2::PositionType)

- •

  `$gap_x` (integer)

- •

  `$gap_width` (integer)

### $style-\>paint\_check ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_diamond ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_expander ($window, $state\_type, $area, $widget, $detail, $x, $y, $expander\_style)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$expander_style` (Gtk2::ExpanderStyle)

### $style-\>paint\_extension ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height, $gap\_side)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

- •

  `$gap_side` (Gtk2::PositionType)

### $style-\>paint\_flat\_box ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_focus ($window, $state\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_handle ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height, $orientation)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

- •

  `$orientation` (Gtk2::Orientation)

### $style-\>paint\_hline ($window, $state\_type, $area, $widget, $detail, $x1, $x2, $y)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x1` (integer)

- •

  `$x2` (integer)

- •

  `$y` (integer)

### $style-\>paint\_layout ($window, $state\_type, $use\_text, $area, $widget, $detail, $x, $y, $layout)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$use_text` (boolean)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$layout` (Pango::Layout)

### $style-\>paint\_option ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_polygon ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $fill, $x1, $y1, ...)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$fill` (boolean)

- •

  `$x1` (integer) x coordinate of the first vertex

- •

  `$y1` (integer) y coordinate of the first vertex

- •

  ... (list) pairs of x and y coordinates

### $style-\>paint\_resize\_grip ($window, $state\_type, $area, $widget, $detail, $edge, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$edge` (Gtk2::Gdk::WindowEdge)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_shadow ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_shadow\_gap ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height, $gap\_side, $gap\_x, $gap\_width)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

- •

  `$gap_side` (Gtk2::PositionType)

- •

  `$gap_x` (integer)

- •

  `$gap_width` (integer)

### $style-\>paint\_slider ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height, $orientation)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

- •

  `$orientation` (Gtk2::Orientation)

### $style-\>paint\_spinner ($window, $state\_type, $area, $widget, $detail, $step, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Window)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$step` (integer)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

Since: gtk+ 2.20

### $style-\>paint\_tab ($window, $state\_type, $shadow\_type, $area, $widget, $detail, $x, $y, $width, $height)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$shadow_type` (Gtk2::ShadowType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget)

- •

  `$detail` (string or undef)

- •

  `$x` (integer)

- •

  `$y` (integer)

- •

  `$width` (integer)

- •

  `$height` (integer)

### $style-\>paint\_vline ($window, $state\_type, $area, $widget, $detail, $y1\_, $y2\_, $x)

- •

  `$window` (Gtk2::Gdk::Drawable)

- •

  `$state_type` (Gtk2::StateType)

- •

  `$area` (Gtk2::Gdk::Rectangle or undef)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

- •

  `$y1_` (integer)

- •

  `$y2_` (integer)

- •

  `$x` (integer)

### pixbuf = $style-\>render\_icon ($source, $direction, $state, $size, $widget, $detail=undef)

- •

  `$source` (Gtk2::IconSource)

- •

  `$direction` (Gtk2::TextDirection)

- •

  `$state` (Gtk2::StateType)

- •

  `$size` (Gtk2::IconSize)

- •

  `$widget` (Gtk2::Widget or undef)

- •

  `$detail` (string or undef)

### $style-\>get\_style\_property ($widget\_package, ...)

- •

  `$widget_package` (string)

- •

  ... (list)

Since: gtk+ 2.16

### color = $style-\>text ($state)

- •

  `$state` (Gtk2::StateType)

### color = $style-\>text\_aa ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>text\_aa\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### gc = $style-\>text\_gc ($state)

- •

  `$state` (Gtk2::StateType)

### scalar = $style-\>white

### scalar = $style-\>white\_gc

### scalar = $style-\>xthickness

### scalar = $style-\>ythickness

## SIGNALS

- **realize** (Gtk2::Style)

  - **unrealize** (Gtk2::Style)

  ## ENUMS AND FLAGS

### enum Gtk2::ArrowType

- •

  'up' / 'GTK\_ARROW\_UP'

- •

  'down' / 'GTK\_ARROW\_DOWN'

- •

  'left' / 'GTK\_ARROW\_LEFT'

- •

  'right' / 'GTK\_ARROW\_RIGHT'

- •

  'none' / 'GTK\_ARROW\_NONE'

### enum Gtk2::ExpanderStyle

- •

  'collapsed' / 'GTK\_EXPANDER\_COLLAPSED'

- •

  'semi-collapsed' / 'GTK\_EXPANDER\_SEMI\_COLLAPSED'

- •

  'semi-expanded' / 'GTK\_EXPANDER\_SEMI\_EXPANDED'

- •

  'expanded' / 'GTK\_EXPANDER\_EXPANDED'

### enum Gtk2::Gdk::WindowEdge

- •

  'north-west' / 'GDK\_WINDOW\_EDGE\_NORTH\_WEST'

- •

  'north' / 'GDK\_WINDOW\_EDGE\_NORTH'

- •

  'north-east' / 'GDK\_WINDOW\_EDGE\_NORTH\_EAST'

- •

  'west' / 'GDK\_WINDOW\_EDGE\_WEST'

- •

  'east' / 'GDK\_WINDOW\_EDGE\_EAST'

- •

  'south-west' / 'GDK\_WINDOW\_EDGE\_SOUTH\_WEST'

- •

  'south' / 'GDK\_WINDOW\_EDGE\_SOUTH'

- •

  'south-east' / 'GDK\_WINDOW\_EDGE\_SOUTH\_EAST'

### enum Gtk2::IconSize

- •

  'invalid' / 'GTK\_ICON\_SIZE\_INVALID'

- •

  'menu' / 'GTK\_ICON\_SIZE\_MENU'

- •

  'small-toolbar' / 'GTK\_ICON\_SIZE\_SMALL\_TOOLBAR'

- •

  'large-toolbar' / 'GTK\_ICON\_SIZE\_LARGE\_TOOLBAR'

- •

  'button' / 'GTK\_ICON\_SIZE\_BUTTON'

- •

  'dnd' / 'GTK\_ICON\_SIZE\_DND'

- •

  'dialog' / 'GTK\_ICON\_SIZE\_DIALOG'

### enum Gtk2::Orientation

- •

  'horizontal' / 'GTK\_ORIENTATION\_HORIZONTAL'

- •

  'vertical' / 'GTK\_ORIENTATION\_VERTICAL'

### enum Gtk2::PositionType

- •

  'left' / 'GTK\_POS\_LEFT'

- •

  'right' / 'GTK\_POS\_RIGHT'

- •

  'top' / 'GTK\_POS\_TOP'

- •

  'bottom' / 'GTK\_POS\_BOTTOM'

### enum Gtk2::ShadowType

- •

  'none' / 'GTK\_SHADOW\_NONE'

- •

  'in' / 'GTK\_SHADOW\_IN'

- •

  'out' / 'GTK\_SHADOW\_OUT'

- •

  'etched-in' / 'GTK\_SHADOW\_ETCHED\_IN'

- •

  'etched-out' / 'GTK\_SHADOW\_ETCHED\_OUT'

### enum Gtk2::StateType

- •

  'normal' / 'GTK\_STATE\_NORMAL'

- •

  'active' / 'GTK\_STATE\_ACTIVE'

- •

  'prelight' / 'GTK\_STATE\_PRELIGHT'

- •

  'selected' / 'GTK\_STATE\_SELECTED'

- •

  'insensitive' / 'GTK\_STATE\_INSENSITIVE'

### enum Gtk2::TextDirection

- •

  'none' / 'GTK\_TEXT\_DIR\_NONE'

- •

  'ltr' / 'GTK\_TEXT\_DIR\_LTR'

- •

  'rtl' / 'GTK\_TEXT\_DIR\_RTL'

## SEE ALSO

Gtk2, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
