home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14794 < prev    next >
Encoding:
Text File  |  1992-08-31  |  2.5 KB  |  52 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!usc!sdd.hp.com!ncr-sd!sagpd1!bberqu
  3. From: bberqu@sagpd1 ()
  4. Subject: Popup menus (help!!)
  5. Message-ID: <1992Aug31.173244.1282@sagpd1>
  6. Keywords: popup
  7. Date: Mon, 31 Aug 1992 17:32:44 GMT
  8. Lines: 42
  9.  
  10.  
  11. Hi,
  12.  
  13. I have three popup menus within a dialog box and am trying to figure out
  14. the best way to handle them, I know system 7 has support for them, but 
  15. I would like my application to work with earlier versions of the OS also.
  16.  
  17. Here's how I'm doing it, I create the static text to the side of the 
  18. popupmenu with ResEdit (using DITL/DLOG editor), and also the popup menus
  19. (with the Menu editor).  Since I don't know the width of the menus in 
  20. ResEdit to make boxes for the popupmenus to the right of the static text 
  21. as user Items, I calculate in my program based on where the static text 
  22. item's rect is and the width of the popup menu, the rectangle for the popupmenu.
  23. I also create a control for the popup menu for that rectangle and store
  24. the menuhandle in the control's refcon field.  Everything works fine up to 
  25. this point, handling them is another story.
  26.  
  27. It seems like all I should have to do to handle popup menus is when 
  28. ModalDialog detects an event within the dialog it should pass the 
  29. information to my filterProc function. If I know where the event happened 
  30. and the dialog pointer I could call FindControl which would return me the 
  31. control, and I've previously stored the menu handle in the control refcon 
  32. field, so then I could simply call PopMenuSelect with the controls rect 
  33. and the menuhandle, however I don't, understand CDEFs so FindControl 
  34. doesn't seem to be returning the control handle, also ModalDialog does not 
  35. seem to be passing me the dialog pointer (should it be?).  I suspect 
  36. FindControl is not finding the control because of my CDEF (it doesn't do
  37. anything right now but return 1).  I know very little about CDEFs, IM 
  38. doesn't seem to explain them very well (at least I don't understand them), 
  39. I looked for information on them in bookstores over the weekend, but 
  40. with no luck.  
  41.  
  42. Am I on the right track or totally off base.  If I'm on the right track, 
  43. could somebody please explain CDEFs or point me to a good book on the 
  44. subject and if ModalDialog will give me the information I need to do this.
  45. I also don't understand how ModalDialog works either, but somebody explained 
  46. at least how the ModalDialog and filterProc functions work together.
  47. If I'm off base, please give me some info on how you would do it.
  48.  
  49. Thanks in advance, sorry for the long mail and hope its understandable.
  50.  
  51. Brian
  52.