Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 11c5630b2c8f00f64861e0dac51a202a > files > 57

php-gtk2-2.0.1-12mdv2010.0.i586.rpm

<?php
/**
 * Spin buttons are not showing up with the right value when first shown. They
 * always appear with a value of 0 instead of the given value. When you click
 * the up arrow, the value goes to <min>+1 not <value>+1.
 *
 * You have to explicityly set the value in order for it to show up by default.
 */
$win = new GtkWindow();
$win->connect_simple('destroy', array('Gtk', 'main_quit'));

// Should appear with a value of 5. Actually appears with a value of 0.
$spin = new GtkSpinButton(new GtkAdjustment(5, 1, 10, 1, 1, 1), 1, 2);

// You have to explicitly call set_value() to have the default show correctly.
//$spin->set_value(5);

$win->add($spin);
$win->show_all();
Gtk::main();
?>