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