Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!decwrl!shlump.nac.dec.com!shodha.dec.com!elvira!ridder From: ridder@elvira.enet.dec.com (Hans Ridder) Newsgroups: comp.sys.amiga.tech Subject: Re: Mutual Exclude Gadgets Keywords: Gadgets Message-ID: <555@shodha.dec.com> Date: 29 Dec 89 16:39:37 GMT References: <947@lpami.wimsey.bc.ca> <22023@usc.edu> Sender: news@shodha.dec.com Organization: Digital Equipment Corporation, Customer Support Center Lines: 37 In article <22023@usc.edu> papa@pollux.usc.edu (Marco Papa) writes: >Most data structures (including Gadgets) have "user defined" fields at >the end of them. That's where you can fool with. In any case it is >very easy to build "custom user gadgets", with whatever additional >fields you want by creating your own modified structure: > >struct MyGadget { > struct Gadget gad; > long extension1; > char *extension2; > BOOL togglegad; >} > >This is portable, and will work with future releases as well. ^^^^^^^^^^^^^^^ Just one question. What if Commodore adds some stuff to the Gadget structure making it larger? You'd have to re-compile your code with new includes, or else their new larger Gadget structure would overlay your "extensions". So really, the *binary* code could possibly not work with future releases. No? I think your first sentence above was right on the mark though. I would suggest using the "User" field directly, or as a pointer to your extension structure. Then future changes to the size of a structure would not affect you, and your *binary* would be compatible. >-- Marco Papa 'Doc' -hans ======================================================================== Hans-Gabriel Ridder Digital Equipment Corporation ridder@elvira.enet.dec.com Customer Support Center ...decwrl!elvira.enet!ridder Colorado Springs, CO