Gtk2::Style(3)
π Gtk2::Style(3) π
User Contributed Perl Documentation
okay bestie, this is the Gtk2::Style page and it is long, so buckle up π
we're doing this in parts.
π NAME π
Gtk2::Style β a wrapper for GtkStyle. that's the whole pitch, that's the vibe, periodt. π«Ά
π HIERARCHY π
Glib::Object
+----Gtk2::Style
so Gtk2::Style sits right under Glib::Object. no cap. β¨
β¨ METHODS β¨
style = Gtk2::Style->new
brand new style object, fresh out the box. π
$style->apply_default_background ($window, $set_bg, $state_type, $area, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Window$set_bgβ boolean$state_typeβ aGtk2::StateType$areaβ aGtk2::Gdk::Rectangleorundef$xβ integer$yβ integer$widthβ integer$heightβ integer
style = $style->attach ($window)
$windowβ aGtk2::Gdk::Window
gives you back a style. π¦
boolean = $style->attached
hands you a boolean, bestie. that's it. that's the method. π
$style->set_background ($window, $state_type)
$windowβ aGtk2::Gdk::Window$state_typeβ aGtk2::StateType
color = $style->base ($state)
$stateβ aGtk2::StateType
you get a color back. πΈ
gc = $style->base_gc ($state)
$stateβ aGtk2::StateType
you get a gc back. π
color = $style->bg ($state)
$stateβ aGtk2::StateType
color. π
gc = $style->bg_gc ($state)
$stateβ aGtk2::StateType
gc. β¨
pixmap = $style->bg_pixmap ($state, $pixmap=undef)
$stateβ aGtk2::StateType$pixmapβ aGtk2::Gdk::Pixmaporundef(and note the$pixmap=undefin the signature β it defaults toundefπ«Ά)
you get a pixmap. π
scalar = $style->black
scalar. yes. that's literally it. π€
scalar = $style->black_gc
also a scalar. π
style = $style->copy
gives you a style back β a copy. obviously. π
color = $style->dark ($state)
$stateβ aGtk2::StateType
color. π
gc = $style->dark_gc ($state)
$stateβ aGtk2::StateType
gc. β
$style->detach
no args, no return listed, just vibes. π§
Gtk2->draw_insertion_cursor ($widget, $drawable, $area, $location, $is_primary, $direction, $draw_arrow)
okay heads up: this one is called on Gtk2 itself, not on $style. don't @ me, that's just how it's written. π
$widgetβ aGtk2::Widget$drawableβ aGtk2::Gdk::Drawable$areaβ aGtk2::Gdk::Rectangle$locationβ aGtk2::Gdk::Rectangle$is_primaryβ boolean$directionβ aGtk2::TextDirection$draw_arrowβ boolean
Since: gtk+ 2.4 π±
color = $style->fg ($state)
$stateβ aGtk2::StateType
color. π
gc = $style->fg_gc ($state)
$stateβ aGtk2::StateType
gc. β¨
scalar = $style->font_desc
a scalar, and it's your font description. π
list = $style->get (widget_package, ...)
list = $style->get_style_property (widget_package, ...)
$widget_packageβ string, the widget package name (ex:'Gtk2::TreeView')...β list, the list of property names
okay so here's the tea β β this fetches and returns the values for the style properties you name in ... for a widget of type widget_package. and <hotpink>get</hotpink> is just an alias for get_style_property. same method, two names, iconic behavior. π
my $size = $style->get_style_property ("expander-size");
β οΈ Note: thegetmethod shadowsGlib::Object::get(see "get and set" inGlib::Object). this shouldn't be a problem sinceGtk2::Styledefines no properties (as ofgtk+ 2.16). but if you have a class that's derived fromGtk2::Styleand adds a property, or if a new version of gtk+ adds a property toGtk2::Style, then that property can be accessed withget_property. noted, bestie. π
Since: gtk+ 2.16 π±
color = $style->light ($state)
$stateβ aGtk2::StateType
color. π
gc = $style->light_gc ($state)
$stateβ aGtk2::StateType
gc. π«
color = $style->lookup_color ($color_name)
$color_nameβ string
color. π¨
Since: gtk+ 2.10 π±
iconset = $style->lookup_icon_set ($stock_id)
$stock_idβ string
you get an iconset. cute. πΌοΈ
color = $style->mid ($state)
$stateβ aGtk2::StateType
color. π
gc = $style->mid_gc ($state)
$stateβ aGtk2::StateType
gc. β¨
$style->paint_arrow ($window, $state_type, $shadow_type, $area, $widget, $detail, $arrow_type, $fill, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$arrow_typeβ aGtk2::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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer$gap_sideβ aGtk2::PositionType$gap_xβ integer$gap_widthβ integer
$style->paint_check ($window, $state_type, $shadow_type, $area, $widget, $detail, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetπ (noor undefon this one, bestie β it's justGtk2::Widget)$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer
$style->paint_diamond ($window, $state_type, $shadow_type, $area, $widget, $detail, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer
$style->paint_expander ($window, $state_type, $area, $widget, $detail, $x, $y, $expander_style)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widget(again, noor undefπ )$detailβ string orundef$xβ integer$yβ integer$expander_styleβ aGtk2::ExpanderStyle
$style->paint_extension ($window, $state_type, $shadow_type, $area, $widget, $detail, $x, $y, $width, $height, $gap_side)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer$gap_sideβ aGtk2::PositionType
$style->paint_flat_box ($window, $state_type, $shadow_type, $area, $widget, $detail, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer
$style->paint_focus ($window, $state_type, $area, $widget, $detail, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string π (noor undefhere, just plainstring)$xβ integer$yβ integer$widthβ integer$heightβ integer$orientationβ aGtk2::Orientation
$style->paint_hline ($window, $state_type, $area, $widget, $detail, $x1, $x2, $y)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$x1β integer$x2β integer$yβ integer
$style->paint_layout ($window, $state_type, $use_text, $area, $widget, $detail, $x, $y, $layout)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$use_textβ boolean$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$xβ integer$yβ integer$layoutβ aPango::Layout
$style->paint_option ($window, $state_type, $shadow_type, $area, $widget, $detail, $x, $y, $width, $height)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widget(yep, noor undef, stay woke π )$detailβ string orundef$xβ integer$yβ integer$widthβ integer$heightβ integer
$style->paint_polygon ($window, $state_type, $shadow_type, $area, $widget, $detail, $fill, $x1, $y1, ...)
$windowβ aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$edgeβ aGtk2::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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType$shadow_typeβ aGtk2::ShadowType$areaβ aGtk2::Gdk::Rectangleorundef$widgetβ aGtk2::Widgetorundef$detailβ string orundef$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β aGtk2::Gdk::Drawable$state_typeβ aGtk2::StateType
β¦and that's exactly where part 1 runs out, bestie π the rest of paint_shadow_gap's args are waiting in the next chunk. π
okay so picking up right where we left off, the rest of the params for that method were:
$shadow_type(Gtk2::ShadowType) β aGtk2::ShadowType, bestie π$area(Gtk2::Gdk::Rectangleorundef) β aGtk2::Gdk::Rectangleorundef, mysterious π¦$widget(Gtk2::Widgetorundef) β aGtk2::Widgetorundefβ¨$detail(string orundef) β a string orundefπ$x(integer) β an integer, no cap π$y(integer) β an integer, fr fr π$width(integer) β an integer, periodt π$height(integer) β an integer, slay π$gap_side(Gtk2::PositionType) β aGtk2::PositionType, iconic π$gap_x(integer) β an integer, iykyk π₯$gap_width(integer) β an integer, literally π
$style->paint_slider π
$style->paint_slider ($window, $state_type, $shadow_type, $area, $widget,
$detail, $x, $y, $width, $height, $orientation)
$window(Gtk2::Gdk::Drawable) β aGtk2::Gdk::Drawable, bestie β¨$state_type(Gtk2::StateType) β aGtk2::StateType, lowkey π¦$shadow_type(Gtk2::ShadowType) β aGtk2::ShadowType, highkey π$area(Gtk2::Gdk::Rectangleorundef) β aGtk2::Gdk::Rectangleorundef, no cap π$widget(Gtk2::Widgetorundef) β aGtk2::Widgetorundef, fr fr π$detail(string orundef) β a string orundef, periodt π₯$x(integer) β an integer, slay π$y(integer) β an integer, literally π$width(integer) β an integer, obsessed π$height(integer) β an integer, ate π$orientation(Gtk2::Orientation) β aGtk2::Orientation, main character energy π
$style->paint_spinner π
$style->paint_spinner ($window, $state_type, $area, $widget, $detail, $step,
$x, $y, $width, $height)
$window(Gtk2::Gdk::Window) β aGtk2::Gdk::Window, bestie π$state_type(Gtk2::StateType) β aGtk2::StateType, ngl β¨$area(Gtk2::Gdk::Rectangleorundef) β aGtk2::Gdk::Rectangleorundef, iykyk π¦$widget(Gtk2::Widgetorundef) β aGtk2::Widgetorundef, fr fr π$detail(string orundef) β a string orundef, periodt π$step(integer) β an integer, slay π₯$x(integer) β an integer, no cap π$y(integer) β an integer, literally π$width(integer) β an integer, iconic π$height(integer) β an integer, ate π
Since: gtk+ 2.20
$style->paint_tab π
$style->paint_tab ($window, $state_type, $shadow_type, $area, $widget,
$detail, $x, $y, $width, $height)
$window(Gtk2::Gdk::Drawable) β aGtk2::Gdk::Drawable, bestie β¨$state_type(Gtk2::StateType) β aGtk2::StateType, lowkey π¦$shadow_type(Gtk2::ShadowType) β aGtk2::ShadowType, highkey π$area(Gtk2::Gdk::Rectangleorundef) β aGtk2::Gdk::Rectangleorundef, no cap π$widget(Gtk2::Widget) β aGtk2::Widget, fr fr π$detail(string orundef) β a string orundef, periodt π₯$x(integer) β an integer, slay π$y(integer) β an integer, literally π$width(integer) β an integer, obsessed π$height(integer) β an integer, ate π
$style->paint_vline π
$style->paint_vline ($window, $state_type, $area, $widget, $detail, $y1_,
$y2_, $x)
$window(Gtk2::Gdk::Drawable) β aGtk2::Gdk::Drawable, bestie β¨$state_type(Gtk2::StateType) β aGtk2::StateType, ngl π¦$area(Gtk2::Gdk::Rectangleorundef) β aGtk2::Gdk::Rectangleorundef, iykyk π$widget(Gtk2::Widgetorundef) β aGtk2::Widgetorundef, fr fr π$detail(string orundef) β a string orundef, periodt π₯$y1_(integer) β an integer, slay π$y2_(integer) β an integer, literally π$x(integer) β an integer, no cap π
$style->render_icon πΌοΈ
pixbuf = $style->render_icon ($source, $direction, $state, $size, $widget,
$detail=undef)
$source(Gtk2::IconSource) β aGtk2::IconSource, bestie π$direction(Gtk2::TextDirection) β aGtk2::TextDirection, lowkey β¨$state(Gtk2::StateType) β aGtk2::StateType, highkey π¦$size(Gtk2::IconSize) β aGtk2::IconSize, iconic π$widget(Gtk2::Widgetorundef) β aGtk2::Widgetorundef, fr fr π$detail(string orundef) β a string orundef, periodt π₯
$style->get_style_property π
$style->get_style_property ($widget_package, ...)
$widget_package(string) β a string, no cap β¨...(list) β a list, slay π¦
Since: gtk+ 2.16
$style->text π¨
color = $style->text ($state)
$state(Gtk2::StateType) β aGtk2::StateType, bestie π
$style->text_aa β¨
color = $style->text_aa ($state)
$state(Gtk2::StateType) β aGtk2::StateType, fr fr π¦
$style->text_aa_gc π
gc = $style->text_aa_gc ($state)
$state(Gtk2::StateType) β aGtk2::StateType, literally π₯
$style->text_gc π
gc = $style->text_gc ($state)
$state(Gtk2::StateType) β aGtk2::StateType, periodt π
scalar = $style->white π€
scalar = $style->white_gc π
scalar = $style->xthickness β¨
scalar = $style->ythickness π¦
β¨ SIGNALS β¨
realize(Gtk2::Style) β realize, iconic πunrealize(Gtk2::Style) β unrealize, periodt π₯
π 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 π
Gtk2Glib::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
That's the whole vibe, bestie. This page came from perl v5.42.0, dated 2025-07-25, and it's for Gtk2::Style(3). Stay iconic πβ¨
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms