home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18851 < prev    next >
Encoding:
Text File  |  1992-11-24  |  2.1 KB  |  58 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!mundil.cs.mu.OZ.AU!mtc
  3. From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
  4. Subject: Problem with System 7 Popup CDEF - New One!
  5. Message-ID: <9232913.7250@mulga.cs.mu.OZ.AU>
  6. Keywords: popup CDEF 7
  7. Sender: news@cs.mu.OZ.AU
  8. Organization: Computer Science, University of Melbourne, Australia
  9. Date: Tue, 24 Nov 1992 02:41:36 GMT
  10. Lines: 46
  11.  
  12. Dear Netters,
  13.  
  14. I am trying to implement a popup menu in a dialog, using the proper System 7
  15. cdef. It seems to work fine. However, there is one small problem. When I select
  16. an item that is not the first one, the popup continues to display the first item
  17. in the list. However the item selected is returned correctly, and has its 
  18. tick mark against it and everything...but no difference to the appearance of
  19. the popup when you let go of the menu.
  20.  
  21. Here is the code I use (the dialog filter proc is straight out of inside Mac)
  22.  
  23. {Create the pop up menu}
  24.   GetDItem(dlog, kSSPopup, itemType, itemHandle, dispRect);
  25.   popctrl := NewControl(dlog, dispRect, title, true, popupTitleRightJust, 
  26.          kMenuID, 0, popupMenuCDEFProc, 0);
  27.   ...
  28.  
  29.   repeat
  30.     begin
  31.       ModalDialog(@MarkFilter, itemhit);
  32.       case itemhit of
  33.     kSSPopup: 
  34.       begin
  35.         itemselect := TrackControl(popctrl, absRect.topleft, POINTER(-1));
  36.         itemselect := GetCtlValue(popctrl);
  37.         GetItem(myPopUpData^^.mHandle, itemselect, CurrentStudentName);
  38.         ...
  39.  
  40. So, what am I doing wrong? Did I forget a constant for always_display_selected_
  41. item? Apple's own HIG's say to draw it this way. I would have thought it would
  42. be done by the CDEF, not by the user.
  43.  
  44. Any ideas gratefully appreciated.
  45.  
  46. Feel free to post or mail, but I would prefer mail... :-)
  47.  
  48. Many regards,
  49.     Mike.
  50.  
  51. -- 
  52. Michael Cutter                        email: mtc@mundil.cs.mu.oz.au
  53. Ictinus Network Development Team             mtc@arbld.unimelb.edu.au
  54. BCAT Development Team                 snail: c/- 3 Barton Street
  55. Department of Architecture & Building        Hawthorn, VIC, 3122 
  56. University of Melbourne, Australia           AUSTRALIA
  57. Sort of 3rd Year Computer Scientist   phail: 61-3-853 9717
  58.