scrolled event/bind help! 
Author Message
 scrolled event/bind help!

Hi,

Is there a way to provide a callback that runs when a scrolled canvas (or
whatever) is scrolled?

I made a canvas:

$canvas = $fr_graph->Scrolled('Canvas',
                               '-scrollbars' =>  's' ,
                              '-scrollregion' => ['0',  '10', .17 * $#trace, '0'],

                                                                  );

And, I put a graph on it:

        for (0 .. ($#trace - 1)){
                $id[$_] = $canvas->create('line',

                (blah, blah, blah...)

I created a second scrollbar for moving a 'cursor' (a vertical line) within
the graph.

I want to make the cursor visible again whenever the user scrolls away from
it - maybe put it in the middle of the visible portion of the graph whenever
the user scrolls away from the cursor.

Come to think of it is there a direct way to tell if a canvas item is
visible? I planned to check in the callback if my cursor was between the
return values of $canvas->xview.

Thanks.

Ron Hartikka
    Interautomation, Inc.

    Dearborn => 313-248-5401
    Mobile   => 734-216-2845

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



Sat, 31 May 2003 02:04:59 GMT  
 scrolled event/bind help!
Hi,
Try this!

$xscrollbar = $canvas->Subwidget('xscrollbar');

sub win_scrolling
{
  my ($left,$right) = $canvas->xview;

Quote:
}

Good Luck!
Mikael Alenfalk


Mon, 02 Jun 2003 06:15:20 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help binding mouse events to canvas

2. How to bind a scroll bar to more than one listbox

3. bind and scrolled control (mlistbox)

4. Binding to items on Scrolled Canvas

5. binding to scroll bar

6. Binding 2 scrolled listboxes to a third.

7. Problem with binding events on TkPerl canvas

8. Binding resize event

9. How to bind 'Back Space' event

10. Binding mouse event to a canvas

11. Binding event to entry widget

12. binding an event to X

 

 
Powered by phpBB® Forum Software