home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / acorn / 8019 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  2.8 KB

  1. Path: sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!jwil1
  2. Newsgroups: comp.sys.acorn
  3. Subject: Re: Correctly placed menus in C
  4. Message-ID: <1992Jul25.013615.1193@cs.aukuni.ac.nz>
  5. From: jwil1@cs.aukuni.ac.nz (TMOTA)
  6. Date: Sat, 25 Jul 1992 01:36:15 GMT
  7. Sender: jwil1@cs.aukuni.ac.nz (TMOTA)
  8. References: <712029596snx@klaatu.demon.co.uk>
  9. Organization: Computer Science Dept. University of Auckland
  10. Lines: 45
  11.  
  12. Steve@klaatu.demon.co.uk (Steve Loft) writes:
  13.  
  14. >I've read a lot of messages moaning (quite rightly) about PD programs
  15. >which don't pop up menus at the right height on the icon bar.  This is
  16. >a problem in C when your menu has dashed line entries acting as spacers,
  17. >because of what is apparently a bug in RISC_OSLib.  I was amazed to learn
  18. >from someone who has version 4 of C that the bug is still present.
  19.  
  20. >Now, can someone tell me an easy way of circumventing the bug?  Possibly
  21. >with some code fragments to demonstrate?  Does the fix involve taking out
  22. >the event_process call and handling it all 'manually' in the way you
  23. >would in an assembler or Basic program, or is there an easier way?  
  24. >I don't really want to restructure my code.
  25.  
  26. Well, I'm afraid that (as with many bits of RISC OS Lib) the only way to
  27. get it to do things *right* is to completely replace that portion of
  28. ROLib with your on code (Makes ROLib very useful, he says sarcastically)
  29.  
  30. In DSEdit II, I wanted dotted lines in my main menu, so I replaced baricon
  31. (which gave the same functionality and saved over 1kB of code size!)
  32. and brought up the menu myself (a single call to Wimp_CreateMenu swi
  33. using the menu definition created with Menu_New etc.)
  34.  
  35. The problem with this is that *^&%()!!! ROLib doesn't know when YOU made
  36. that menu and when IT made the menu, so any menu selection on my main menu
  37. was trapped by ROLib and returned to me as a hit on my sound-sample menu!
  38.  
  39. So I spent another 5 minutes on it, and popped up my own menus, and then
  40. RISC OS Lib bowed out of the menu system altogether. The result:
  41. My code is smaller but does more. (And most likely does it faster, too)
  42.  
  43. You will find that there are many places where you can significantly reduce
  44. application size, speed up your code, and save a lot of time, by simply
  45. writing the code to do things for yourself instead of trying to get RISC
  46. OS Lib to work how you want it to... In this case of menus, the fix
  47. is actually very quick and easy (half an hour total to completely fix all
  48. my menu code in 150kB of source...)
  49.  
  50. (In fact, about 50% of my development time has been spent on getting around
  51. RISC OS Lib rather than writing actual code... My suggestion: don't even
  52. start using ROLib.)
  53. -- 
  54. _________________  "I'd like to answer this question in two ways:
  55.   /____ _ _/_ __       First in my normal voice, and then
  56.  // / //_//_ /_/       in a silly, high-pitched whine." (Monty Python)
  57.