Tk::Scale -> slow callback 
Author Message
 Tk::Scale -> slow callback

Quote:

> Hi all,

> I've detected a problem with the Tk::Scale widget.

> My Tk is 800.023 (that one provided with ActiveState Perl-5.6.1, build 633),
> so it's on Win32 (Win2k, SP2 in my case).

> Problem: I've got a callback that takes about 500ms to be executed.
> If I want to move the slider in the scale widget it's very slow (as you
> would expect with such a slow callback). But when I release the slider
> at some point, I would expect, that the last call to the callback would be
> executed with the value, the slider has been released on. But this is
> not the case; it's some intermediate value between start of sliding and
> stop of sliding.

> Even worse, this problem also occurs with faster callbacks - you
> just have to move the slider faster to see the error.

> Questions:
> - can this be fixed somehow?
> - any idea for a workaround?

I cannot reproduce this with the following piece of code:

use Tk;
$top = new MainWindow;
$top->Scale(-command => sub {

                select(undef,undef,undef,0.5);
            })->pack;

MainLoop;

But maybe it's a problem only on Windows?

Regards,
        Slaven

--

    Berlin Perl Mongers - http://www.*-*-*.com/
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Sat, 30 Apr 2005 19:47:33 GMT  
 Tk::Scale -> slow callback
Hi Slaven,

your code works on both Unix and Windows. I could not find out
yet, what's different to the code I'm using. I played around a bit,
to make the code more like what I'm doing, but it's working all the
time.
Well, now it's up to me...

Thanks anyway!
--------------------------------------------------------------------------------
Gerhard Petrowitsch                Tel.: +49 8151 270 126
SP3D Chip Design GmbH     FAX:  +49 8151 270 200
Petersbrunnerstr. 17      Home Office: +49 821 9069 741

--------------------------------------------------------------------------------
Be like the ant.  When the ant gets a mixture of sand and sugar,
it selects only sugar; it neglects sand. See only good in others.
Pay no attention to the bad.                    (Sathya Sai Baba)
--------------------------------------------------------------------------------

                      Slaven Rezic                                                                                                                                  


                      Sent by:                      Subject:   Re: Tk::Scale -> slow callback                                                                        

                      tanford.EDU                   Classification:                                                                                                  

                      12-11-2002 11:56                                                                                                                              
                      Please respond to                                                                                                                              
                      slaven.rezic                                                                                                                                  

Quote:

> Hi all,

> I've detected a problem with the Tk::Scale widget.

> My Tk is 800.023 (that one provided with ActiveState Perl-5.6.1, build 633),
> so it's on Win32 (Win2k, SP2 in my case).

> Problem: I've got a callback that takes about 500ms to be executed.
> If I want to move the slider in the scale widget it's very slow (as you
> would expect with such a slow callback). But when I release the slider
> at some point, I would expect, that the last call to the callback would be
> executed with the value, the slider has been released on. But this is
> not the case; it's some intermediate value between start of sliding and
> stop of sliding.

> Even worse, this problem also occurs with faster callbacks - you
> just have to move the slider faster to see the error.

> Questions:
> - can this be fixed somehow?
> - any idea for a workaround?

I cannot reproduce this with the following piece of code:

use Tk;
$top = new MainWindow;
$top->Scale(-command => sub {

                         select(undef,undef,undef,0.5);
                 })->pack;

MainLoop;

But maybe it's a problem only on Windows?

Regards,
             Slaven

--

    Berlin Perl Mongers - http://berliner.pm.org
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Sun, 01 May 2005 16:54:26 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Tk::Scale -> slow callback

2. Tk::Scale -> slow callback

3. Canvas->Scale and Tk::Scale conflict?

4. object->method() as Tk subroutine callback, How?

5. Scale widget's callback

6. Tk::Dialog => slow

7. Slow system() in callback

8. a bug in $canv->scale() ?

9. Changing the value shown by Tk::Scale

10. Changing the value shown by Tk::Scale

11. Tk::Canvas scale question

12. Perl/TK scrolled canvas scale IMAGE function???

 

 
Powered by phpBB® Forum Software