Gtk2::Scale(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::Scale β€” the vibe check

okay bestie, so this is a page from the User Contributed Perl Documentation (that's the manual name, we stan a community effort) and it's all about Gtk2::Scale β€” literally just a thin little wrapper around GtkScale, the widget that gives you a slider with numbers on it. yes queen, that slider. the one you drag. iconic behavior.


✨ NAME ✨

Gtk2::Scale β€” it's the wrapper for GtkScale. that's it, that's the name, short and sweet πŸ’…


🌸 HIERARCHY 🌸

so like, here's the family tree, the ancestry, the lineage, the main character bloodline:

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Range
                      +----Gtk2::Scale

every single one of those is its ancestor, no skips, no cuts. Gtk2::Scale is a Gtk2::Range is a Gtk2::Widget is a Gtk2::Object is a Glib::InitiallyUnowned is a Glib::Object. periodt 🫢


πŸ¦‹ INTERFACES πŸ¦‹

it also implements these, bestie β€” think of them as the little extra personalities it carries around:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::Orientable

⭐ METHODS ⭐

πŸŽ€ $scale->add_mark ($value, $position, $markup)

drops a lil mark on the scale. here's the tea on the args:

  • $value (double)
  • $position (Gtk2::PositionType)
  • $markup (string or undef)
Since: gtk+ 2.16 β€” so if you're on something ancient, this one's not gonna pick up the phone πŸ’€

πŸŽ€ $scale->clear_marks

yeets every single mark off the scale. clean slate, fresh start, new era ✨

Since: gtk+ 2.16

πŸŽ€ integer = $scale->get_digits / $scale->set_digits ($digits)

get or set how many decimal places are shown. args:

  • $digits (integer)

πŸŽ€ boolean = $scale->get_draw_value / $scale->set_draw_value ($draw_value)

get or set whether the value text is actually drawn. args:

  • $draw_value (boolean)

πŸŽ€ layout = $scale->get_layout

hands you the Pango::Layout used for the value text. lowkey useful.

Since: gtk+ 2.4

πŸŽ€ (x, y) = $scale->get_layout_offsets

gives you back the offsets, as a two-element list. coordinates girlies rise πŸ™ˆ

Since: gtk+ 2.4

πŸŽ€ positiontype = $scale->get_value_pos / $scale->set_value_pos ($pos)

where the value text sits. args:

  • $pos (Gtk2::PositionType)

πŸ’œ PROPERTIES πŸ’œ

  • 'digits' (integer : default 1 : readable / writable / private / static-nick / static-blurb) β€” the number of decimal places that are displayed in the value
  • 'draw-value' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the current value is displayed as a string next to the slider
  • 'value-pos' (Gtk2::PositionType : default "top" : readable / writable / private / static-nick / static-blurb) β€” the position in which the current value is displayed

🌈 STYLE PROPERTIES 🌈

these ones are read-only bestie, look but don't touch:

  • 'slider-length' (integer : default 31 : readable / private / static-nick / static-blurb) β€” length of scale's slider
  • 'value-spacing' (integer : default 2 : readable / private / static-nick / static-blurb) β€” space between value text and the slider/trough area

πŸ”₯ SIGNALS πŸ”₯

string = format-value (Gtk2::Scale, double)

it fires, you hand back a string, the scale shows your string. chef's kiss, no notes πŸ‘‘


🧚 ENUMS AND FLAGS 🧚

enum Gtk2::PositionType

  • 'left' / GTK_POS_LEFT
  • 'right' / GTK_POS_RIGHT
  • 'top' / GTK_POS_TOP
  • 'bottom' / GTK_POS_BOTTOM

all four, all accounted for, nothing missing πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're all in the same friend group:

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Range


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

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


and that's the whole page, bestie, we ate and left no crumbs 🫢 this was Gtk2::Scale(3), generated from perl v5.42.0 on 2025-07-25 β€” mwah, drink water, go forth and slay your sliders πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from