Gtk2::Viewport(3)
β¨ NAME β¨
Gtk2::Viewport β bestie, it's literally just a wrapper for GtkViewport π
Like. That's the whole thing. It's the Perl-side glow-up of the C widget. Let's get into it π«Ά
πΈ HIERARCHY πΈ
Okay so the family tree? Iconic lineage, no cap:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Viewport
Six generations of ancestors. Main character energy all the way down π
π¦ INTERFACES π¦
This thing also implements:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::Buildable
Yes bestie, accessibility AND buildable support. She does it all β¨
π METHODS π
widget = Gtk2::Viewport->new ($hadjustment=undef, $vadjustment=undef)
Make a brand new viewport, fr fr. She takes two args, both optional (they default to undef):
$hadjustmentβ aGtk2::Adjustmentorundef$vadjustmentβ aGtk2::Adjustmentorundef
window or undef = $viewport->get_bin_window
Grabs the bin window, or undef if there isn't one. Heads up: Since: gtk+ 2.20 β
adjustment = $viewport->get_hadjustment
$viewport->set_hadjustment ($adjustment)
Getter/setter duo for the horizontal adjustment π
$adjustmentβ aGtk2::Adjustment
shadowtype = $viewport->get_shadow_type
$viewport->set_shadow_type ($type)
Read it, write it. The shadow type of the box around the viewport π
$typeβ aGtk2::ShadowType
adjustment = $viewport->get_vadjustment
$viewport->set_vadjustment ($adjustment)
Same vibe as the horizontal one but, you know, vertical π
$adjustmentβ aGtk2::Adjustment
window or undef = $viewport->get_view_window
The view window, or undef. Since: gtk+ 2.22 π₯
π PROPERTIES π
'hadjustment' (Gtk2::Adjustment : default undef : readable / writable / construct / private / static-nick / static-blurb)
The GtkAdjustment that determines the values of the horizontal position for this viewport.
'shadow-type' (Gtk2::ShadowType : default "in" : readable / writable / private / static-nick / static-blurb)
Determines how the shadowed box around the viewport is drawn.
'vadjustment' (Gtk2::Adjustment : default undef : readable / writable / construct / private / static-nick / static-blurb)
The GtkAdjustment that determines the values of the vertical position for this viewport.
Note the default on'shadow-type'is literally"in", bestie. That's the vibe out of the box π
π₯ SIGNALS π₯
set-scroll-adjustments (Gtk2::Viewport, Gtk2::Adjustment, Gtk2::Adjustment)
That's the signal, and those are the three things it hands you: the viewport itself, then two Gtk2::Adjustments. Slay π«Ά
π ENUMS AND FLAGS π
enum Gtk2::ShadowType
The full menu, no skips:
'none'/GTK_SHADOW_NONE'in'/GTK_SHADOW_IN'out'/GTK_SHADOW_OUT'etched-in'/GTK_SHADOW_ETCHED_IN'etched-out'/GTK_SHADOW_ETCHED_OUT
Perl-side name on the left, C constant on the right. iykyk π
π SEE ALSO π
Go read these too, bestie, they're the whole friend group:
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::ObjectGtk2::WidgetGtk2::ContainerGtk2::Bin
π COPYRIGHT π
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 page, babe β this doc came to you via perl v5.42.0, dated 2025-07-25. Go build something cute with it π§β¨
π¦ 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