Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 examining the Monastery: (2)
As of 2014-09-21 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls