Canvas->Scale and Tk::Scale conflict? 
Author Message
 Canvas->Scale and Tk::Scale conflict?

Hi,

I think I found a conflict between the scale function of the canvas and the
Scale widget.
I have had this conflict throughout several versions of perl and Tk
Here is a piece of code that generates the following error:

bad window path name "all"

the following code runs fine, untill you uncomment line 3 ???
anybody seen this one before?

-----------------------------------
use Tk;
use Tk::Canvas;
#use Tk::Scale;
# <-- Turn this on to see conflict
my $main = new MainWindow();
$c = $main->Scrolled(qw/Canvas -scrollbars se/)->pack();
$cicle = $c -> createOval(10, 10, 25, 25, -outline=>"red");
$c->scale( 'all' , 0 , 0 , 8 , 8 );
MainLoop;
-------------------------------------



Sat, 21 Aug 2004 00:16:05 GMT  
 Canvas->Scale and Tk::Scale conflict?

Quote:

> use Tk;
> use Tk::Canvas;
> #use Tk::Scale;
> # <-- Turn this on to see conflict
> my $main = new MainWindow();
> $c = $main->Scrolled(qw/Canvas -scrollbars se/)->pack();
> $cicle = $c -> createOval(10, 10, 25, 25, -outline=>"red");
> $c->scale( 'all' , 0 , 0 , 8 , 8 );
> MainLoop;

FYI, for core Tk widgets you don't need to use() them.  For the Scrolled
widget,
$c references the enclosing frame, so use Subwidget() to get the actual
Canvas
reference:

use Tk;
#use Tk::Canvas;
#use Tk::Scale;

my $main = new MainWindow();
$c = $main->Scrolled(qw/Canvas -scrollbars se/)->pack();
$cicle = $c -> createOval(10, 10, 25, 25, -outline=>"red");
$c->Subwidget('scrolled')->scale( 'all' , 0 , 0 , 8 , 8 );
MainLoop;

What's a core Tk widget? Well, you really don't need to know, and when
Perl/Tk can't find
one of your widgets it tries to autoload it and let's you know via a
warn() message.  Then
go ahead and put the use Tk::non-core-widget statement in your code.

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



Sat, 21 Aug 2004 02:02:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Tk::Canvas scale question

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

3. Perl/TK scrolled canvas scale zoom NOOP?

4. Tk::Scale -> slow callback

5. Tk::Scale -> slow callback

6. Tk::Scale -> slow callback

7. How to scale canvas coordinates?

8. scaling canvas items

9. Scaling text on a canvas

10. Zooming in a canvas with the scale method

11. Scaling in the canvas

12. Regarding Canvas and Scale widget

 

 
Powered by phpBB® Forum Software