Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uunet!maverick.ksu.ksu.edu!hoss!fergvax!252u3129 From: 252u3129@fergvax.unl.edu (Mike Gleason) Newsgroups: comp.sys.mac.programmer Subject: Re: WDEF Question Message-ID: <252u3129.661119588@fergvax> Date: 13 Dec 90 20:19:48 GMT References: <252u3129.660984232@fergvax> <47306@apple.Apple.COM> Sender: news@hoss.unl.edu (Network News Administer) Distribution: comp Organization: University of Nebraska - Lincoln Lines: 50 stevec@Apple.COM (Steve Christensen) writes: >252u3129@fergvax.unl.edu (Mike Gleason) writes: >>[that he wanted to create a window with his own custom window definition >> procedure, but he was getting the default window instead...] >The ProcID you specify in NewWindow is related to the WDEF's resource ID, >but not the same beast. It's defined as: > 16 * WDEF resource ID + variation code >which means any particular WDEF can support up to 16 variations on a theme. >It also means that WDEF resource IDs come in the range of 0-4095 (that's >2^12 - 1, right?)... Thanks to everyone who pointed that out to me. Ironically, I spent more time looking for that little tidbit than to write my entire Amiga WDEF. I guess I should have actually read the entire Window Manager chapter, instead of just skimming it like college students are known for. Dave Hairston also said to check out Apple's sample code, which I did. I didn't find any code directly on WDEFs, but I did have TN 256 "Stand Alone Code" which had a bunch of useless junk in it. Basically Apple's sample WDEF is this: switch(param) { case wDraw: Draw(...); break; . . case wDrawGIcon: DrawGIcon(...); break; } That's it. The actual Draw(...) functions are just stubs with nothing in them. I was quite disappointed that they hadn't bothered to code an actual WDEF. Instead, I found the source for a NeXT WDEF, by jbx, E. Celeste, J. Pritikin, which helped immensely! There were a lot of tricky nuances that I never would have caught without their source... Thanks Guys! I'd like to see TN 256 rewritten with actual working code for WDEFs, LDEFs, MDEFs instead of stubs. In Apple's defense though, they do provide some assembly source in the defprocs directory at apple.com, but Ich weisse assembly nicht, and I think anyone would agree that C or Pascal source is much easier to comprehend. Of course I'm not blaming you for all this SteveC.... mike gleason "How I've waited for you to come 252u3129@fergvax.unl.edu I've been here all alone Now that you've arrived, please stay awhile And I promise not to keep you long... I'll keep you forever" -- Slayer