Path: utzoo!mnetor!uunet!munnari!lawley From: lawley@munnari.oz (Michael J. Lawley) Newsgroups: comp.sys.amiga Subject: Re: The Resource Problem Message-ID: <2047@munnari.oz> Date: 22 Mar 88 07:49:11 GMT References: <4595@garfield.UUCP> Organization: Comp Sci, Melbourne Uni, Australia Lines: 52 in article <4595@garfield.UUCP>, john13@garfield.UUCP (John Russell) says: > > The idea of adding resources to the graphical display is fairly simple, with > several ways to do it. Anyone with a reasonable grasp of Intuition could > construct the functions necessary to read definitions for menus, gadgets, > etc from a file and use those to configure his display. Of course the format > one person would use would be incompatible with that of everyone else... > > Nothing's stopping anybody from creating resource files that look like: > > [myprog.res] > menu 1 is 5 items > item 1 is "Open" shortcut O > ... > item 5 is "Quit" shortcut Q > etc > > window background pen is 2 > window foreground pen is 3 > > window startup is > position 100 50 > size 200 by 100 > ^^^ Personally, I think this sort of format is a bit verbose and cumbersome however, with my nifty new product (see below) you could write a simple program to convert this sort of format to the format I use. [ stuff deleted ] > John Actually, I've already written all the routines for just such a system. All I have to do is work out how to convert them into a shared library (like intuition.library etc) and write a converter that takes standard C structure initialisers and converts them to the resource file format and I will release it. It is in fact more sophisticated than what you describe as it keeps track of everything you have opened (windows, screens, menus etc) and closes them, deallocates the memory used for temp storage etc when the program exits. It is based on the Mac way of doing things (since I wrote an application using them on the Mac and found it great for simple but sophisticated looking interfaces), so you can define a window with an ID of, say, 1 then open window 1 as many times as you like, it will open a new window each time on the specified screen, open it if necessary, attatching any gadgets, menus etc. Eventually, I hope to get an editor written along the lines of PowerWindows or ResEdit (for the Mac), but until then the converter will have to do. (Maybe someone else would like to write the editor) Mike.