buggy as a very buggy thing?

From: Date: Sat, 19 Jan 2002 17:28:20 +0000
Subject: buggy as a very buggy thing?
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-1014@lists.php.net to get a copy of this message
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(); ?>

« previous php.gtk.general (#1014) next »