home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / oop / macapp3 / 348 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  2.6 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!apple!applelink.apple.com
  2. From: KVICTOR@AppleLink.Apple.COM (Victor Consulting, Ken Victor,PAS)
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: MenuWidth Bug?
  5. Message-ID: <726200013.3667500@AppleLink.Apple.COM>
  6. Date: 5 Jan 93 02:09:00 GMT
  7. Sender: daemon@Apple.COM
  8. Organization: AppleLink Gateway
  9. Lines: 43
  10.  
  11. does anyuone know if there is a bug in the toolbox CalcMenuSize when dealing
  12. with styled hierarchical menus?
  13.  
  14. my situation is as follows:
  15.  
  16. i have several hierarchical menus declared (with no items) as CMNU resources in
  17. my .r file.  the menuId of these menus is greater than mLastMenu.  the main
  18. menus for these hierarchical menus are also delcared as CMNU resources in my .r
  19. file, with menuIDs less than mLastMenu.  all resource IDs are equal to menuIDs.
  20. the main menus are listed in the kMBarDisplayed resource and the hieracrhical
  21. menus are listed in the kMBarHierarchical resource.
  22.  
  23. dynamically i create additional items for my hierarchical menus, including
  24. other hierarchical menus (being sure to only use a menuID < 235 and one that
  25. isn't already in use).  in my dosetupmenus, i enable my items as appropriate,
  26. and enable the declared hierarchical menu as well.
  27.  
  28. everything was working fine, and just the way i expected it to until i decided
  29. i wanted some of the added items to be bold or outlined.  i changed my
  30. dosetupmenus to issue either a SetItemStyle or (MacApp's) SetStyle, depending
  31. on whether the menuid was greater or less than or equal to mLastMenu.  i even
  32. tried calling CalcMenuSize or NeedCalcMenuSize.  my hierarchical menus are
  33. being drawn too narrow for the styled items, and thus the styled items have the
  34. infamous 3 dots on the end.  its as if CalcMenuSize is calculating a width
  35. while ignoring the item's style.
  36.  
  37. i tried patching the menuwidth in the menuinfo record after my call to
  38. CalcMenuSize (in dosetupmenus) to no avail.  i've traced this as far as inside
  39. toolbox MenuSelect.  MenuSelect seems to set the menuwidth to -1 the first time
  40. it needs the hierarchical menu, and then it calls CalcMenuSize before
  41. displaying the hierarchical menu.  if i set an atrap at CalcMenuSize after
  42. entering MenuSelect, and then patch menuwidth AFTER CalcMenuSize does its
  43. thing, my menus display with the width i've patched in...
  44.  
  45. HELP??? :-(
  46.  
  47. Ken Victor
  48. (415) 964-9870
  49.  
  50. p.s. i'm running sys 7.1, macapp 3.0.1.  i think i saw something similar in a
  51. previous macapp 2.01 app i developed running on sys 7.0 and 7.01 with and
  52. without tuner, but i didn't follow that one as much as this one.
  53.  
  54.