[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Ooops I mean Mac::Events



> >My Question Is:  Is there a way to use these Mac::Events features to
> >read mouse activity without deactivating all of the rest of the mouse
> >functions?
> >In this script although I can draw boxes I cannot drag the window or use
> >the close box, grow box, or zoom box.
>
> Just an FYI:  Apple events are different than these events.  Apple events
> are specific events for interapplication communication.
>
[Chris Nandor]


Ooops

I looked at the trumpet tutor2 code at Kevin Reids site as kindly recommended by David Seay.
and saw something on the order of   storing the location of the old keyDown routine with

$OldDownHandler = $Event[keyDown];
$Event[keyDown] = \&KeyDown;

and then putting this in the Key down subroutine

  if (${FrontWindow()} != ${$Window->window}) {
    return &$OldDownHandler();

It seemed like a clever way to restore the old function

I tried something similar using
$OldMouseDownHandler = $Event[mouseDown];

and returning &$OldMouseDownHandler in my Mouse Down handling subroutine

but only suceeded in giving myself an error in Windows.pm

Can't call method "where" without a package or object reference.
File 'Callisto HD:Servers:MacPerl É:lib:Mac:Windows.pm'; Line 917


Am I missing something?  Is there something about Mouse events that are different than key events?
Has anyone used this strategy successfully?

Thanks again for putting up with the questions.  It's a lot friendler here than on
comp.lang.perl.misc.

Ilir Topalli


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org