Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

perl tk button on windows 8 touchpad does not animate if touched as expected

by abonvici (Initiate)
on May 07, 2014 at 18:35 UTC ( #1085356=perlquestion: print w/ replies, xml ) Need Help??
abonvici has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I wrote a program that should run on a hp elitepad 900 with windows 8. Everything works BUT tk widgets , for example button, doesn't reacts when pressed by fingers as they do with mouse. I tried any sort of option, the finger touch make the -command sub work as expected but the button is freezed. Is there a way to make a widget button act as a normal button on touchpad? Please help me because this behavior invalidate totally this wonderful toolkit, perl tk, on this class of devices. Thank a lot in advance for your support

Comment on perl tk button on windows 8 touchpad does not animate if touched as expected
Re: perl tk button on windows 8 touchpad is doesn't not animate if touched
by Anonymous Monk on May 07, 2014 at 18:58 UTC
    What happens when you ->activate a button, does it animate?
Re: perl tk button on windows 8 touchpad is doesn't not animate if touched
by zentara (Archbishop) on May 07, 2014 at 19:03 UTC
    the finger touch make the -command sub work as expected but the button is freezed. Is there a way to make a widget button act as a normal button

    I have no Tablet, but just shooting the breeze, how about manually changing the button's state in the -command callback?

    For a simple example:

    #!/usr/bin/perl use strict; use Tk; my $mw = MainWindow->new; my $but; # declare before so you can use it in the callback $but = $mw->Button(-text => "Hello World", ## This callback works (text is changed) under Win95, Win98 (5.6.1) # # -command => [sub { my $b = $_[0], #notice comma # $b->configure(-text => "Hello Stranger"); # }, $b]); #This callback works under Win95, Win98 (5.6.1) and Linux (5.6.0) -command=>[\&change, $but]); $but->pack; MainLoop; sub change { my $but = $_[0], #notice comma $but->configure(-text=>"Hello Stranger", -bg => 'pink'); }

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

      Thank a lot Zentara . i'll try your suggestion tomorrow at work , where i have the touchpad, and a i'll let you know. Only one doubt. How to force the button update to show the state change? .Could be sufficient call tk::button->update?

        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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2014-10-25 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls