Need help with canvas text and bindings 
Author Message
 Need help with canvas text and bindings

Hi,

   I am tyring to build a graphical drawing app using (mainly) the
canvas widget. I'm running into 2 small problems which I'm hoping
someone can help me with.

   First, I'm using $canvas->scale to emulate zoom in/out. This
works fine except for text. All the 'graphical' items scale fine
but the text stays the same size. Is there a way to correct this
other than dynamically changing the font size? Is there a better
way to do zooming?

   Second, I can't get $canvas->bind to work the way I understand
that it should. I have these two bindings:

        $parent->bind($canvas, '<B1>' => sub {....
        $parent->bind($canvas, '<A><B1>' => sub {...

   I would like the second binding to be activated when the 'A'
key is pressed and the first mouse button is pressed. However, the
first binding is always activated when B1 is pressed regardless of
key 'A' being pressed or not. The second binding never activates. So,
where am I missing the boat?

   BTW, I'm using Tk-b8 on a Sun Sunos 4.1.3.

   Thanks in advance for the help.

Thomas Rock



Fri, 10 Jul 1998 03:00:00 GMT  
 Need help with canvas text and bindings
Hi,
 Hi,
   I am tyring to build a graphical drawing app using (mainly) the
canvas widget. I'm running into 2 small problems which I'm hoping
someone can help me with.

   First, I'm using $canvas->scale to emulate zoom in/out. This
works fine except for text. All the 'graphical' items scale fine
but the text stays the same size. Is there a way to correct this
other than dynamically changing the font size? Is there a better
way to do zooming?

   Second, I can't get $canvas->bind to work the way I understand
that it should. I have these two bindings:

        $parent->bind($canvas, '<B1>' => sub {....
        $parent->bind($canvas, '<A><B1>' => sub {...

   I would like the second binding to be activated when the 'A'
key is pressed and the first mouse button is pressed. However, the
first binding is always activated when B1 is pressed regardless of
key 'A' being pressed or not. The second binding never activates. So,
where am I missing the boat?

   BTW, I'm using Tk-b8 on a Sun Sunos 4.1.3.

   Thanks in advance for the help.

Thomas Rock



Sat, 11 Jul 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help with canvas text and bindings

2. help binding mouse events to canvas

3. newbie help with anonymous subroutine syntax for text widget key binding

4. Problem with binding events on TkPerl canvas

5. Need help w/ binding to NDBM package

6. Binding mouse event to a canvas

7. Binding to whole Canvas

8. Create a key binding on a canvas?

9. problem binding keys on a canvas

10. Binding to items on Scrolled Canvas

11. Binding Canvas Items question

12. Need some helps with binding

 

 
Powered by phpBB® Forum Software