GtkVScrollbar Constructor

GtkVScrollbar ([GtkAdjustment adjustment = null]);

Creates a new vertical scrollbar. If the adjustment parameter is omitted or set to null, an GtkAdjustment will be created for you. Since all of the adjustments values are set to 0, it might be easier and faster to construct the adjustment yourself.

Example 147. Creating and styling a vertical scrollbar

//Creating and styling a vertical scrollbar

//At first, define some values for the adjustment
$value     = 50;
$lower     = 1;
$upper     = 100;
$step_incr = 1;
$page_incr = 10;
$page_size = 10;

//Create the adjustment with the values
$adj = new GtkAdjustment(
    $value, $lower, $upper,
    $step_incr, $page_incr, $page_size
//Create the scrollbar with the adjustment
$sb = new GtkVScrollbar($adj);
//Set the name of the widget, so that it can be styled individually
//Re-set the value, since passing the adjustment to the scrollbar
// resets the value to zero

//Here we apply some style properties to our scrollbar
style "mysbstyle" {
  GtkVScrollbar::has-forward-stepper = 0
  GtkVScrollbar::has-secondary-forward-stepper = 1
  GtkVScrollbar::fixed-slider-length = 1
  GtkVScrollbar::min-slider-length = 10
} widget "*.my-scrollbar" style "mysbstyle"');

//Normal stuff, you know it
$wnd = new GtkWindow();
$wnd->set_default_size(-1, 300);
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));