home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!mundil.cs.mu.OZ.AU!mtc
- From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
- Subject: Problem with System 7 Popup CDEF - New One!
- Message-ID: <9232913.7250@mulga.cs.mu.OZ.AU>
- Keywords: popup CDEF 7
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- Date: Tue, 24 Nov 1992 02:41:36 GMT
- Lines: 46
-
- Dear Netters,
-
- I am trying to implement a popup menu in a dialog, using the proper System 7
- cdef. It seems to work fine. However, there is one small problem. When I select
- an item that is not the first one, the popup continues to display the first item
- in the list. However the item selected is returned correctly, and has its
- tick mark against it and everything...but no difference to the appearance of
- the popup when you let go of the menu.
-
- Here is the code I use (the dialog filter proc is straight out of inside Mac)
-
- {Create the pop up menu}
- GetDItem(dlog, kSSPopup, itemType, itemHandle, dispRect);
- popctrl := NewControl(dlog, dispRect, title, true, popupTitleRightJust,
- kMenuID, 0, popupMenuCDEFProc, 0);
- ...
-
- repeat
- begin
- ModalDialog(@MarkFilter, itemhit);
- case itemhit of
- kSSPopup:
- begin
- itemselect := TrackControl(popctrl, absRect.topleft, POINTER(-1));
- itemselect := GetCtlValue(popctrl);
- GetItem(myPopUpData^^.mHandle, itemselect, CurrentStudentName);
- ...
-
- So, what am I doing wrong? Did I forget a constant for always_display_selected_
- item? Apple's own HIG's say to draw it this way. I would have thought it would
- be done by the CDEF, not by the user.
-
- Any ideas gratefully appreciated.
-
- Feel free to post or mail, but I would prefer mail... :-)
-
- Many regards,
- Mike.
-
- --
- Michael Cutter email: mtc@mundil.cs.mu.oz.au
- Ictinus Network Development Team mtc@arbld.unimelb.edu.au
- BCAT Development Team snail: c/- 3 Barton Street
- Department of Architecture & Building Hawthorn, VIC, 3122
- University of Melbourne, Australia AUSTRALIA
- Sort of 3rd Year Computer Scientist phail: 61-3-853 9717
-