Re: ProgressBar doesn't pulse

Am Sonntag 14 Januar 2007 04:21 schrieb muppet:
On Jan 13, 2007, at 5:54 PM, Ben Staude wrote:
Any ideas why it doesn't work? Is this related to some Gtk/KDE

This typically happens when you don't return control the main loop.
Does your program respond at all while it's supposed to be pulsing?

I am using this as test code (was posted by zentara here: gnome org/msg00854.html):

use warnings;
use strict;
use Gtk2;


my $window = new Gtk2::Window;
my $pbar = new Gtk2::ProgressBar;

# set_text not allowed in pulser 
# !  $pbar->set_text('foobar'); 

my $vb = new Gtk2::VBox(0, 0);

my $b = new Gtk2::Button('Quit');

$b->signal_connect('clicked', sub {Gtk2->main_quit});
$window->signal_connect('destroy', sub {Gtk2->main_quit});


my $timer = Glib::Timeout->add (10,\&show_progress);
# timer will run until callback returns false 


sub show_progress{
return 1;

This test script does work as expected on another Linux machine (running 
Debian Sarge with KDE), but the progressbar looks different (more like gnome, 
whereas on Kubuntu (where it doesn't work), they have some KDE integration of 
gtk and therefor a KDE progressbar).

You might also try setting the pulse step.  The default is 0.1, but
you may need a different value for some reason or another.  Difficult
to tell without more information.

Maybe the code above helps sorting out programming issues (as the test script 
isn't mine:-)). Besides this, I don't know in which direction to search for 
the cause or provide information? Maybe someone on the list can run the test 
script on their Kubuntu to find out whether it's related to that?

Thanks a lot,


Telefonate ohne weitere Kosten vom PC zum PC:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]