Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
Enabling the Navigation Services default behavior in its dialogs
Q: Drag and dropping a file or folder in my Navigation Services dialog does not change the location but this action works in other application. How can I make this working in my application as well?
A: Drag and dropping a file or folder in my Navigation Services dialog does not change the location but this action works in other application. How can I make this working in my application as well?
What you need is a non-NULL
eventProc
when you call any of the Navigation Services dialogs creation or execution. Even an eventProc
which does nothing is fine. That way, the Navigation Services code has a chance to add its default behavior event processing to yours (which does nothing), else, if your eventProc
is NULL
, the Navigation Services does not try to add his default behavior, assuming you don't want any behavior at all. And the default behavior event processing is, of course, the one which handles the drag and drop to change the location.
You can use the following eventProc
shown in Listing 1:
Listing 1 An empty event Proc.
pascal void myDoNothingEventProc(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void * callBackUD) { } |
And you can specify this eventProc
with the following Listing 2:
Listing 2 Using the empty event Proc.
NavEventUPP myDoNothingEventProcUPP = NewNavEventUPP(myDoNothingEventProc); err = NavCreatePutFileDialog( &navOptions, kmyApplicationSignature, kmyFileType, myDoNothingEventProcUPP, clientData, &navDialog ); DisposeNavEventUPP(myDoNothingEventProcUPP); |
In the previous Listing 2, any of the other Navigation Services APIs such as NavPutFile, NavGetFile, NavCreateChooseFileDialog, etc could have been used as well.
Document Revision History
Date | Notes |
---|---|
2004-10-15 | New document that explains how to enable the default behavior of the Navigation Services dialogs. |
Copyright © 2004 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2004-10-15