[comp.sys.mac.programmer] User item in a SFGetFile dialog - how?

d83_sven_a@tekno.chalmers.se (SVEN AXELSSON) (10/15/89)

Hi.
I want to put a user-item into my custom SFGetFile dialog. How do I get the
user-item procedure connected? I can't do the usual GetItem - SetItem stuff
since SFPGetFile will read the dialog template for me. Is there a way of
handling this, short of writing my own filterProc - something I do NOT
want to do.

+-------------------------+--------------------------------+------------------+
|   Sven Axelsson         |  d83_sven_a@tekno.chalmers.se  |  DISCLAIMER:     |
|   dep:t of Linguistics  |          (^^ best ^^)          |                  |
|   univ. of Gothenburg   |        dlv_sa@hum.gu.se        |  This is not     |
|   SWEDEN                |      usdsa@seguc21.bitnet      |  a disclaimer.   |
+-------------------------+--------------------------------+------------------+

tim@hoptoad.uucp (Tim Maroney) (10/16/89)

In article <2426@tekno.chalmers.se> d83_sven_a@tekno.chalmers.se
(SVEN AXELSSON) writes:
>Hi.

Hello.

>I want to put a user-item into my custom SFGetFile dialog. How do I get the
>user-item procedure connected? I can't do the usual GetItem - SetItem stuff
>since SFPGetFile will read the dialog template for me. Is there a way of
>handling this, short of writing my own filterProc - something I do NOT
>want to do.

No.  But I don't see what's wrong with writing your own filter proc.
Just type in the function definition from Inside Mac and pass the name
of the function to SFPGetFile.  It's certainly no harder than writing a
user item drawing procedure.

Your item filter procedure will get passed a -1 item for initialization.
This is the time to do the GetDItem-SetDItem soft-shoe to bind the user
item drawing procedure.  The entire function shouldn't take more than
ten lines if this is all you're doing.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

Never ascribe to stupidity what can adequately be explained by malice.