Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: perl tk button on windows 8 touchpad is doesn't not animate if touched

by Anonymous Monk
on May 08, 2014 at 06:57 UTC ( [id://1085421]=note: print w/replies, xml ) Need Help??


in reply to Re^2: perl tk button on windows 8 touchpad is doesn't not animate if touched
in thread perl tk button on windows 8 touchpad does not animate if touched as expected

HI all , I workaround this problem doing a change of the background of the button at the begining and the ending of the -command action. As the -command action is relatively long this work in an acceptable way. From a logic point of view:

-command => sub { my $caller_ = $Tk::widget; $caller_->configure(-bg ='red'); $caller_->update; ........................ .....long operation on db $caller_->configure(-bg ='grey'); $caller_->update; }

This work quite well for my needs . Thank a lot

  • Comment on Re^3: perl tk button on windows 8 touchpad is doesn't not animate if touched
  • Download Code

Replies are listed 'Best First'.
Re^4: perl tk button on windows 8 touchpad is doesn't not animate if touched
by zentara (Archbishop) on May 08, 2014 at 13:44 UTC
    .....long operation on db

    Hi, I would just mention that your Tk interface may become unresponsive during that long operation, since it will block the Tk event-loop. You may want to sprinkle some $mw->update; statements in your long db operation, if possible, to keep the eventloop active. For instance, what if you wanted a Cancel button to cancel the long db operation midstream? The Cancel button will not respond.

    There are ways around this, like using threads or forks to do the long db operation and set a threads shared variable when done. But that is getting way beyond what you probably want to do.

    See PerlTk on a thread... for an introduction.

    BTW, did $button->activate() in the -command callback give any animation?


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1085421]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found