[comp.sys.amiga] Graphics and Intuition Questions

adam@lamont.Columbia.edu (adam levin) (04/08/88)

I'm writing a C program that uses the graphics and intuition libraries,
and I have a couple of questions which the (Addison Wesley) RKMs were not
able to clear up.  If you know the solution(s), please reply; I'll summarize.

1.  Is the code fragment on p127 of the Intuition Manual for processing a
    menu event correct?  When I use it, and extend-select (select more than
    one item from a menu strip), my event handler gets in an infinite loop.
    I looked through a lot of the PD source code I've collected from BBSs and
    none of them pay attention to NextSelect.

2.  After using SetAfPt() and SetDrMd() to do subsequent fills with a bi-
    color pattern, I want to go back to using a solid color.  Must I use
    SetAfPt (with a pattern of say, {0xffff, 0xffff}), or is there a more
    proper way of resetting it?

Thank you, thank you, oh, thank you!

WARNING:  The Surgeon General is both a surgeon and a general, so watch it!
							
-- 
Phone:  (914) 359-2900 x340
Post:   Lamont-Doherty Geological Observatory / Palisades, NY 10964
USENET: {ihnp4, decvax, seismo} philabs!lamont!adam
ARPA:   lamont!adam@columbia.edu

jesup@pawl22.pawl.rpi.edu (Randell E. Jesup) (04/10/88)

In article <480@lamont.Columbia.edu> adam@lamont.Columbia.edu (adam levin) writes:
>1.  Is the code fragment on p127 of the Intuition Manual for processing a
>    menu event correct?  When I use it, and extend-select (select more than
>    one item from a menu strip), my event handler gets in an infinite loop.
>    I looked through a lot of the PD source code I've collected from BBSs and
>    none of them pay attention to NextSelect.

	NextSelect is VERY important!  Otherwise, it ignores multiple menu
selections.  Just make sure everything is casted right (often forgotten in
the RKM examples).  If in doubt, walk through with a debugger.

>2.  After using SetAfPt() and SetDrMd() to do subsequent fills with a bi-
>    color pattern, I want to go back to using a solid color.  Must I use
>    SetAfPt (with a pattern of say, {0xffff, 0xffff}), or is there a more
>    proper way of resetting it?

	You are right that the RKMs don't say what to do, but after looking
at graphics/gfxmacros.h, I'd say set the fields in the Rastport to NULL,
their default state.  Do both the pointer and size, just in case, though I
suspect just the pointer would do.

     //	Randell Jesup			      Lunge Software Development
    //	Dedicated Amiga Programmer            13 Frear Ave, Troy, NY 12180
 \\//	beowulf!lunge!jesup@steinmetz.UUCP    (518) 272-2942
  \/    (uunet!steinmetz!beowulf!lunge!jesup) BIX: rjesup
(-: The Few, The Proud, The Architects of the RPM40 40MIPS CMOS Micro :-)

dale@boing.UUCP (Dale Luck) (04/10/88)

In article <639@imagine.PAWL.RPI.EDU> (Randell E. Jesup) writes:
>In article <480@lamont.Columbia.edu> (adam levin) writes:
>>2.  After using SetAfPt() and SetDrMd() to do subsequent fills with a bi-
>>    color pattern, I want to go back to using a solid color.  Must I use
>>    SetAfPt (with a pattern of say, {0xffff, 0xffff}), or is there a more
>>    proper way of resetting it?
>
> I'd say set the fields in the Rastport to NULL,their default state.
> Do both the pointer and size, just in case, though I suspect just
> the pointer would do.

You are right. To get back to solid fill you only need to set the pattern
ptr to NULL. This is more efficient then using a pattern of all F's.

The graphicss library ignores the size unless the the ptr != NULL
so it does not matter what the size is when going to a solid fill
 as a matter of fact a size of '0' is legal and indicates an
areafill pattern of height 1.

Dale Luck