[comp.sys.amiga] Need Intuition Help

mrr@softie.UUCP (Mark Rinfret) (09/11/87)

A short while ago I posted a query with regard to extended selection and 
menus, but I got no responses.  So, I'll put it another way - can anyone
point me to or post an example of menu-handling code that properly handles
extended selection of MutualExclude menu items?  

Next question: Do the AddGList, RemoveGList functions require fullword
alignment of the Gadget structures?  I modified some code to use these and
all hell broke loose.  I know for a fact that my data structures are NOT
fullword aligned (checked with db).  Reverting to AddGadget, RemoveGadget,
RefreshGadgets (vs. ..GList) corrected the problem.  If fullword alignment
is necessary, is there a way to coerce Aztec C to do this for static or
global preset data structures?

Mark


-- 
< Mark R. Rinfret,        mrr@softie, ..rayssd!unisec!softie!mrr             >
< SofTech, Inc.           Home: 401-846-7639                                 >
< 1 Silva Lane,           Work: 401-849-4174                                 >
< Middletown, RI 02840    "The name has changed but I'm still guilty."       >

jimm@mitsumi.UUCP (Jim Mackraz) (09/13/87)

::
I don't have an example for Mutual Exclude Multiple Menu Selection
(or whatever).  Please write me if you have any assumptions about 
Intuition you would like to check.

I'm not sure what you mean by "fullword" alignment.  Intuition Gadget
structures have a pointer as their first element (i think) so must,
like all good structures, be "16-bit word aligned," i.e., be at
an even address.  I can't believe that Aztec doesn't align static
structures.  If you can prove that, I am sure Jim Goodnow would love
to hear about it.  Something like: printf("funky gadget: %lx\n", &fgadget);

AddGList() and the others require that you present as long a list
as you say you do.  Are you casting the NumGads parameter to a LONG?
(else Intuition might be walking a list of 00052a5f gadgets instead of
5.  (If I got that in the wrong order, flame my IBM-PC, not me.)

Sorry about the menus question, send some mail.
	jimm
-- 
	Jim Mackraz
	Mitsumi Technology, Inc.
	{amiga,pyramid}!mitsumi!jimm

cmcmanis%pepper@Sun.COM (Chuck McManis) (09/14/87)

In article <86@softie.UUCP> mrr@softie.UUCP (Mark Rinfret) writes:
>Next question: Do the AddGList, RemoveGList functions require fullword
>alignment of the Gadget structures?  I modified some code to use these and
>all hell broke loose.  I know for a fact that my data structures are NOT
>fullword aligned (checked with db).  Reverting to AddGadget, RemoveGadget,
>RefreshGadgets (vs. ..GList) corrected the problem.  If fullword alignment
>is necessary, is there a way to coerce Aztec C to do this for static or
>global preset data structures?

AddGlist() and RemoveGlist() should not have any different alignment require-
ments than AddGadget() or RemGadget() do. The only difference being a numeric
parameter to indicate the number of gadgets to add or remove. Since you are
using Aztec C my first guess would be that you are not casting the number of
gadgets to a long and thus the number it adds or removes is probably several 
thousand. So change :
	AddGlist(&window,&gadget,4);		
		-to-
	AddGlist(&window,&gadget,(long) 4);

[Note I can't remember off the top of my head if the Glist functions can also
 be used on a requester, which would add an addition NULL pointer to a requester
 struct in their somewhere]


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

rtolly@cca.CCA.COM (Bob Tolly) (09/14/87)

In article <86@softie.UUCP> mrr@softie.UUCP (Mark Rinfret) writes:
>
>Next question: Do the AddGList, RemoveGList functions require fullword
>alignment of the Gadget structures?  I modified some code to use these and
>all hell broke loose.  I know for a fact that my data structures are NOT
>fullword aligned (checked with db).  Reverting to AddGadget, RemoveGadget,
>RefreshGadgets (vs. ..GList) corrected the problem.  If fullword alignment
>is necessary, is there a way to coerce Aztec C to do this for static or
>global preset data structures?


There was a problem with the AddGList library routine shipped with
the Manx 3.4 compiler - I've forgotten how it went, but the
arguments were not getting into registers correctly for the
call to the AddGList ROM routine - the result on my machine was
a crash. There is a patch in the currently supplied Manx
patches to fix it - it's available on most nets, including
PeopleLink and Bix, I think, and from Manx.

Bob Tolly

mrr@softie.UUCP (Mark Rinfret) (09/16/87)

In article <27908@sun.uucp=, cmcmanis%pepper@Sun.COM (Chuck McManis) writes:
= 
= AddGlist() and RemoveGlist() should not have any different alignment require-
= ments than AddGadget() or RemGadget() do. The only difference being a numeric
= parameter to indicate the number of gadgets to add or remove. Since you are
= using Aztec C my first guess would be that you are not casting the number of
= gadgets to a long ...

Nope.  I learned that one a long time ago.  In fact, that's always the first
thing I look for when the Guru visits.  I think Bob Tolly's response  (improper
parameter to register mapping for AddGlist, etc.) might be correct.  As soon as I get a chance to check it out, I'll post some info.

= --Chuck McManis

Mark


-- 
< Mark R. Rinfret,        mrr@softie, ..rayssd!unisec!softie!mrr             >
< SofTech, Inc.           Home: 401-846-7639                                 >
< 1 Silva Lane,           Work: 401-849-4174                                 >
< Middletown, RI 02840    "The name has changed but I'm still guilty."       >