Prima::ScrollBar(3)
π Prima::ScrollBar β¨
okay so bestie, this is the Prima::ScrollBar page from the Prima toolkit docs (that's the User Contributed Perl Documentation section of the perl manpages, iykyk) β and it's literally just about scroll bars. standard vertical ones, standard horizontal ones. that's the whole vibe. π
πΈ NAME πΈ
Prima::ScrollBar β scroll bars. that's it. that's the widget. π
β¨ SYNOPSIS β¨
okay so here's how you actually touch this thing π
use Prima::ScrollBar;
my $sb = Prima::ScrollBar->new( owner => $group, %rest_of_profile);
my $sb = $group-> insert( 'ScrollBar', %rest_of_profile);
my $isAutoTrack = $sb-> autoTrack;
$sb-> autoTrack( $yesNo);
my $val = $sb-> value;
$sb-> value( $value);
my $min = $sb-> min;
my $max = $sb-> max;
$sb-> min( $min);
$sb-> max( $max);
$sb-> set_bounds( $min, $max);
my $step = $sb-> step;
my $pageStep = $sb-> pageStep;
$sb-> step( $step);
$sb-> pageStep( $pageStep);
my $partial = $sb-> partial;
my $whole = $sb-> whole;
$sb-> partial( $partial);
$sb-> whole( $whole);
$sb-> set_proportion( $partial, $whole);
my $size = $sb-> minThumbSize;
$sb-> minThumbSize( $size);
my $isVertical = $sb-> vertical;
$sb-> vertical( $yesNo);
my ($width,$height) = $sb-> get_default_size;
π¦ DESCRIPTION π¦
Prima::ScrollBar implements standard vertical and horizontal scrollbars. literally the little draggy bar. the icon. the moment. π
π API π
π Properties π
autoTrackBOOLEAN β tells the widget whether it should send theChangenotification during mouse tracking events. ngl, you should really only set this to0on very slow computers. default:1.growModeINTEGER β default isgm::GrowHiX, which means the scrollbar tries to keep a constant distance from its right edge to its owner's right edge whenever the owner resizes. perfect for horizontal scrollbars, fr fr. πheightINTEGER β default is$Prima::ScrollBar::stdMetrics[1], which is an operating-system-dependent value that gets determined by callingPrima::Application-> get_default_scrollbar_metrics. and yes, the height matters here because by default you're getting a horizontalScrollBar. that's the tea. βmaxINTEGER β sets the upper limit forvalue. default:100.minINTEGER β sets the lower limit forvalue. default:0.minThumbSizeINTEGER β the minimal thumb breadth, in pixels. the thumb's main dimension can't go smaller than this. default:21.pageStepINTEGER β this is the increment/decrement applied tovalueduring the operations that are supposed to scroll by pages β like clicking the mouse on the strip outside the thumb, or pressing PgDn or PgUp. default:10.partialINTEGER β tells the scrollbar how many imaginary units the thumb should occupy. seewholedown below π. default:10.selectableBOOLEAN β default is0. set it to1and the widget receives keyboard focus; when it's in focus the thumb bar is blinking. main character energy tbh. β¨stepINTEGER β the minimal increment/decrement tovalueduring mouse/keyboard interaction. default is1.valueINTEGER β the basic scrollbar property, bestie. reflects the imaginary position betweenminandmax, and that maps directly to where the thumb sits. default is0.verticalBOOLEAN β determines the main scrollbar style. set it to1for vertical,0for horizontal. and the slay part? it can be changed at run-time, so scrollbars can morph from horizontal to vertical and back. shapeshifter vibes π¦. default is0.wholeINTEGER β tells the scrollbar how many imaginary units correspond to the whole length of the scrollbar. this value has nothing in common withminandmax, ok? think ofpartial+wholetogether as the proportion between the visible size of something (a document, for example) and the whole size of that same "something". default is100.
π Methods π
get_default_sizeβ returns two integers: the default platform-dependent width of a vertical scrollbar, and the height of a horizontal scrollbar. two for one, we love to see it. π«Ά
π Events π
Changeβ theChangenotification gets sent whenever the thumb position of the scrollbar changes β subject to certain limitations whenautoTrackis0. and it's sent when appropriate, no matter whether it happened because of user interaction or because of some side effect from a method you the programmer called. equal opportunity notifier. πTrackβ ifautoTrackis0, this gets called when the user changes the thumb position with the mouse. π±οΈ
π₯ EXAMPLE π₯
here's a whole little working moment, go off π
use Prima;
use Prima::Application name => 'ScrollBar test';
use Prima::ScrollBar;
my $w = Prima::Window->new(
text => 'ScrollBar test',
size => [300,200]);
my $sb = $w-> insert( ScrollBar =>
width => 280,
left => 10,
bottom => 50,
onChange => sub {
$w-> text( $_[0]-> value);
});
run Prima;
π SEE ALSO π
Prima, Prima::Widget, examples/scrollbar.pl, examples/scrollbar2.pl β go read those too, iykyk πβ¨
π AUTHORS π
Dmitry Karasik <dk@plab.ku.dk>, Anton Berezin <tobez@plab.ku.dk> β documentation. tagging them both, absolute icons for writing all this down π«Άπ
and that's the whole page bestie!! no cap, you're now a certified scrollbar understander πβ¨
okay so the tiny fine print at the bottom: this is from perl v5.42.0, dated 2024-08-20, and it's the Prima::ScrollBar(3) manpage. slay, go forth and scroll π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms