Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!usc!bloom-beacon!eru!luth!sunic!chalmers!tekno.chalmers.se!d83_sven_a From: d83_sven_a@tekno.chalmers.se (SVEN AXELSSON) Newsgroups: comp.sys.mac.programmer Subject: Secret coding techniques (was: User item in a SFGetFile dialog - how?) Message-ID: <2466@tekno.chalmers.se> Date: 16 Oct 89 09:46:20 GMT References: <2426@tekno.chalmers.se> <8711@hoptoad.uucp> Organization: Chalmers Univ. of Technology, Gothenburg, Sweden Lines: 35 In article <8711@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes: > 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 OK, I've had a few answers similar to this one. What I meant was that I thought I had to write my own DialogHook procedure - something altogether different (sorry about the mixup). Actually I found out about the -1 item myself shortly after my first posting in Apples source-code examples (SC018-StdFile). The next question is then - where is this documented? Not in Inside Macintosh at least (?) I suppose there are lots and lots of useful but not-too-well- documented techniques for writing code. Is there a definite source for finding them (loke a book or something)? Sven.