---------- >From: "Quentin Smith" <macmania@bit-net.com> >To: MacPerl List <mac-perl@iis.ee.ethz.ch> >Subject: [MacPerl] Mac::Navigation glue >Date: Thu, Apr 8, 1999, 2:30 PM > > On the recent topic of Nav Services, I have written a "glue" for the > Mac::Navigation" module. Name the module "NavServices.pl" and put it in your > site_perl folder. To test it, use the following script: > <snip> > $nav = NavGetFile($default, $options, $types, sub {use > Mac::Events;Mac::Events::DispatchEvent($_[1]->event);}); <snip> Thanks for the module, it has clarified some things that I have been struggling with (such is life when trying to learn Mac toolbox programming, C/C++ and MacPerl simultaneously). Namely, I was trying simply to get the NavGetFile dialog to be movable, and resizable. The simplest way I found wa to give it a dummy eventProc subroutine, but the dialog would not always update itself properly. The subroutine: sub {use Mac::Events;Mac::Events::DispatchEvent($_[1]->event);} seems to have cured most of the anamolies I was observing, but not all. A few questions: 1) Why must the use Mac::Events statement appear within the embedded subroutine in order to work properly? I tried placing it at the beginning of my script with my other use statements, and got an error saying DispatchEvent subroutine was undefined. Is this, in general, necessary when calling 'external' module functions/structures in embedded subroutines? 2) What "entity" does DispatchEvent contact to notify the dialog to handle the current event (I assume it is the NavGetFile's handlers that need to be executed), the system? the dialog directly? 3) Has anyone who has tried NavServices.pl observed that the cursor becomes "jumpy", or turns into a MacPerl Camel with a spinning wheel? 4) I have also been using NavPutFile, which displays a movable, resizable dialog by default. It does not suffer from the cursor anamolies that I observe with NavGetFile, and additionaly the shareware Default Folder 3.0.1 modifies the navigation buttons in the dialog as I would expect, which is nice. This does not happen with NavGetFile, and coupled with the cursor problem leads me to wonder whether a) something else needs to be added to the eventProc subroutine, or b) maybe there is a bug in Navigation.pm. Any thoughts? ---------------------- Mark J. Yannuzzi myannuzzi@aya.yale.edu ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org