Discussion:
help on progressbar
(too old to reply)
aroul
2009-11-10 14:57:58 UTC
Permalink
Hi,


I am trying to learn perl tk. Any help to find the error in this code
greatly appreciated.

Running this code generates below error -


Can't call method "g_start" without a package or object reference at
progressbar.pl line 17.



#!/Perl/bin/perl -w

use strict;

use Tkx;

my $mw = Tkx::widget->new(".");
$mw->g_wm_title ("Title");
$mw->g_wm_geometry ("500x200+500+250");

my $progress = $mw->new_ttk__frame (-padding => "3 3 3 3", -relief =>
"flat");
$progress->g_grid (-column => 0, -row => 1, -sticky => "nwes");


my $pbar = $progress->new_ttk__progressbar (-orient => "horizontal", -
length => 200, -mode => "indeterminate")->g_grid (-column => 0, -row
=> 0, -sticky => "w");

$pbar->g_start();


#$pbar->g_stop();

Tkx::MainLoop()


regards
aroul.
aroul
2009-11-10 16:01:05 UTC
Permalink
Managed to make it work.

Thanks anyone bothered reading my previous email.

aroul.
Post by aroul
Hi,
I am trying to learn perl tk. Any help to find the error in this code
greatly appreciated.
Running this code generates below error -
Can't call method "g_start" without a package or object reference at
progressbar.pl line 17.
#!/Perl/bin/perl -w
use strict;
use Tkx;
my $mw = Tkx::widget->new(".");
$mw->g_wm_title ("Title");
$mw->g_wm_geometry ("500x200+500+250");
my $progress = $mw->new_ttk__frame (-padding => "3 3 3 3", -relief =>
"flat");
$progress->g_grid (-column => 0, -row => 1, -sticky => "nwes");
my $pbar = $progress->new_ttk__progressbar (-orient => "horizontal", -
length => 200, -mode => "indeterminate")->g_grid (-column => 0, -row
=> 0, -sticky => "w");
$pbar->g_start();
#$pbar->g_stop();
Tkx::MainLoop()
regards
aroul.
x***@gmail.com
2016-05-30 14:21:07 UTC
Permalink
Post by aroul
Hi,
I am trying to learn perl tk. Any help to find the error in this code
greatly appreciated.
Running this code generates below error -
Can't call method "g_start" without a package or object reference at
progressbar.pl line 17.
#!/Perl/bin/perl -w
use strict;
use Tkx;
my $mw = Tkx::widget->new(".");
$mw->g_wm_title ("Title");
$mw->g_wm_geometry ("500x200+500+250");
my $progress = $mw->new_ttk__frame (-padding => "3 3 3 3", -relief =>
"flat");
$progress->g_grid (-column => 0, -row => 1, -sticky => "nwes");
my $pbar = $progress->new_ttk__progressbar (-orient => "horizontal", -
length => 200, -mode => "indeterminate")->g_grid (-column => 0, -row
=> 0, -sticky => "w");
$pbar->g_start();
#$pbar->g_stop();
Tkx::MainLoop()
regards
aroul.
Hello,
if still searching, change your "g_start" and "g_stop" to "m_start" and "m_stop". i try and it works but a "Tkx::Update;" is needed to see the changes.
regards
Xavier

Loading...