[prev in list] [next in list] [prev in thread] [next in thread]
List: php-gtk-general
Subject: [PHP-GTK] Re: GtkProgressBar in active mode broken ?
From: 24.176.31.201
Date: 2007-03-07 22:55:16
Message-ID: 6B.96.39663.9234FE54 () pb1 ! pair ! com
[Download RAW message or body]
Łukasz Wojciechowski wrote:
> Hello again
>
> Below is example which is not working (progress bar slider is not
> moving) in my environment (PHP 5.1.6).
> Could anyone confirm this issue ?
>
> <?php
>
> $oWnd = new GtkWindow();
> $oWnd->set_position( Gtk::WIN_POS_CENTER );
> $oWnd->connect_simple( 'destroy', array( 'Gtk', 'main_quit' ) );
>
> $oVbox = new GtkVBox( true, 10 );
> $oButton = new GtkButton( 'click' );
> $oButtonBox = new GtkHButtonBox();
> $oButtonBox->add( $oButton );
> $oVbox->pack_start( $oButtonBox, true, true, 10 );
>
> $oProgressBar = new GtkProgressBar();
> $oProgressBar->set_size_request( 300, 20 );
> $oProgressBar->set_pulse_step( 0.1 );
>
>
> $oVbox->pack_start( $oProgressBar, false, false, 10 );
>
> $oButton->connect_simple( 'clicked', 'Iterate', $oProgressBar );
>
> $oWnd->add( $oVbox );
> $oWnd->show_all();
>
> function Iterate( GtkProgressBar $oProgressBar )
> {
> for( $i = 1; $i <= 10; $i ++ )
> {
> $oProgressBar->pulse();
> while (Gtk::events_pending())
> {
> Gtk::main_iteration();
> }
> sleep( 1 );
> }
>
> Gtk::main_quit();
> }
> Gtk::main();
>
> ?>
Works for me (gtk 2.10 runtime && 5.2.x cvs && php-gtk cvs - winxp)
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic