home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22189 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  2.5 KB

  1. Path: sparky!uunet!olivea!pagesat!spssig.spss.com!uchinews!quads!sgl1
  2. From: sgl1@quads.uchicago.edu (steven gregory lane)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Custom defProc questions
  5. Message-ID: <1993Jan25.214310.19476@midway.uchicago.edu>
  6. Date: 25 Jan 93 21:43:10 GMT
  7. Sender: news@uchinews.uchicago.edu (News System)
  8. Reply-To: sgl1@midway.uchicago.edu
  9. Organization: University of Chicago
  10. Lines: 37
  11.  
  12.  
  13.     I've been encountering some problems with various custom 
  14. definition procedures. I'd love to hear from anyone who may have 
  15. experienced similar difficulties, or who has any explanation for some 
  16. of the strange behavior I've encountered.
  17.     My first problem occurred while I was trying to build a custom 
  18. CDEF under Think C 5.0x. I was using a trick culled from the Think 
  19. Reference which allows me to keep the CDEF code in my main 
  20. segment by packaging a JMP instruction, together with the 
  21. procedure's address, and putting the resulting value into the control's 
  22. contrlDefProc field ( Think Ref 1.0 under "Custom Menus" ). The 
  23. problem is that, when I use this scheme, the CDEF never receives the 
  24. "initCntrl" message, which I use to initialize handles to various 
  25. regions of the control. The first message received is always 
  26. "drawCntrl," which tries to operate on uninitialized handles, and 
  27. crashes messily.
  28.     BUT -- if I build the CDEF in a separate file, compile it as a CODE 
  29. resource, install it in the project's resource file and set my CNTL 
  30. resource's procID accordingly . . . it all works fine. Anyone know why 
  31. the initCntrl message isn't getting sent when the code's in my 
  32. program's main segment?
  33.     Here's another one. I was working with a popup Menu, which 
  34. had a custom MDEF attached. I had the MDEF installed in the main 
  35. segment, as above. In the course of debugging I noticed the MDEF 
  36. was receiving some messages that weren't documented. The new 
  37. "Toolbox Essentials" book documents messages 0-3 for MDEFs. I was 
  38. getting 4s and 5s, sometimes two or three in a row. I looked in the 
  39. header files, and they were defined there -- I believe they were a 
  40. couple of "calcRgn" messages of the sort found in CDEFs. But no 
  41. documentation anywhere. Can anyone tell me why my MDEF 
  42. received these, and what I do with em?
  43.     A last question on popup menus; the menu in question displays 
  44. a grid of icons from which the user can choose. Ideally the menu 
  45. would display the currently selected icon when the menu is sitting 
  46. there inactive, in the same way it would display the current text 
  47. item. Nothing in the Apple documentation seems to cover this. Any 
  48. ideas?
  49.