Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

TKX Time events using After

by Pherry (Initiate)
on Jan 24, 2013 at 22:58 UTC ( #1015242=CUFP: print w/ replies, xml ) Need Help??

There does not appear to be a lot of examples of Tkx specific code snippets out there, especially the basics. Hopefully this helps someone.

#! /usr/bin/perl -w # # tkx_counter.pl # A basic demonstration of time-based refresh using the tkx wrapper # for TK. # Includes a single text label containing an incrementing # number along with a basic progress bar. use strict; use warnings; use Tkx; my $tic = 0; my $mainwindow = Tkx::widget->new("."); my $label = $mainwindow->new_ttk__label(-textvariable => \$tic)->g_pac +k; my $progress_bar = $mainwindow->new_ttk__progressbar( -orient => "horizontal", -mode => "indeterminate", -length => "200", -maximum => "50", -variable => \$tic, )->g_pack; &tix; #first call to increment subroutine Tkx::MainLoop(); sub tix { #increment sub $tic++; Tkx::after(500, \&tix); # after 500ms re-run this sub. }

Comment on TKX Time events using After
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1015242]
Approved by ww
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-27 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls