Fw: [PHP-GTK] buggy as a very buggy thing? - nope
| From: | Steph | Date: | Sat, 19 Jan 2002 18:57:28 +0000 |
| Subject: | Fw: [PHP-GTK] buggy as a very buggy thing? - nope | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-1015@lists.php.net to get a copy of this message | ||
My bad, I just discovered you don't need to set it up in that way and that the upper bound in
activity mode is the limit beyond which the thing will not redraw, rather than (as in progress mode)
the limit beyond which the value will not go. Resizing it means that the value has to go a longer
distance.
Therapy would be good ...
----- Original Message -----
From: "Steph" <Steph.Fox@btinternet.com>
To: "PHP-GTK gen" <php-gtk-general@lists.php.net>
Sent: Saturday, January 19, 2002 5:28 PM
Subject: [PHP-GTK] buggy as a very buggy thing?
or is it my coding? (I'm not sure about this if($count %2) malarky).
Need to get this tested across systems for docs purposes, thank you good people, but this is what
I'm seeing on win32:
If I set_usize() the progress runs once and once only. If I make it hard integers, it will make the
second (reverse) run for about a fifth of the way. If I set_default_size() on $window instead, the
progressbar's size request overrules it.
If I comment out the set_usize() it runs once, reverses to the start point and then conks out half
way through its third run, no clues given. I think if it were my code it wouldn't make the
start of the third run?
No such problems with the progress mode ... we all love the progress mode ....
Code below, sorry to do this but as we all know attachments to the list don't work.
<?
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
function update_bar() {
global $progressbar, $value;
$progressbar->set_value($value);
start_update();
}
function start_update() {
global $progressbar, $value, $count;
if(!($count %2) && $value < 1.0) {
$value += 0.01;
}
elseif(($count %2) && $value > 0.0) {
$value -= 0.01;
}
elseif(!($count %2) && $value == 1.0) {
$count++;
$progressbar->set_orientation(GTK_PROGRESS_RIGHT_TO_LEFT);
$progressbar->configure(1.0, 1.0, 0.0);
$value -= 0.01;
}
elseif(($count %2) && $value == 0.0) {
$count++;
$progressbar->set_orientation(GTK_PROGRESS_LEFT_TO_RIGHT);
$progressbar->configure(0.0, 0.0, 1.0);
$value += 0.01;
}
gtk::timeout_add(200, 'update_bar');
}
$window = &new GtkWindow();
$window->set_uposition(200, 250);
$window->set_policy(false, false, true);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$vbox = &new GtkVBox();
$window->add($vbox);
$adjustment = &new GtkAdjustment(0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
$value = $adjustment->value;
$progressbar = &new GtkProgressBar($adjustment);
$progressbar->set_activity_mode(true);
//$progressbar->set_usize(gdk::screen_width()/2, 30);
$vbox->pack_start($progressbar);
$progressbar->show();
$count = 1;
$window->show_all();
start_update();
gtk::main();
?>
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-gtk-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net