[comp.sys.amiga.tech] Window Border Colors

schwager@m.cs.uiuc.edu (01/19/90)

I'd like to open up a standard Intuition window in a custom screen, and use
any color I choose for the border.  Is this possible?  I tried using
SetAPen and SetBPen and SetOlPen on the screen's RastPort, but none of
these worked to make the entire border one nice lovely color.  It always
comes up using color register 1.  I couldn't find this in the RKM's;
perhaps I'm just dense...  Thanks for any help...
-Mike Schwager
INTERNET:schwager@cs.uiuc.edu               |
UUCP:{uunet|convex|pur-ee}!uiucdcs!schwager |
BITNET:schwager%cs.uiuc.edu@uiucvmd         |
University of Illinois, Dept. of Comp. Sci. |

peter@cbmvax.commodore.com (Peter Cherna) (01/19/90)

In article <42700023@m.cs.uiuc.edu> schwager@m.cs.uiuc.edu writes:
>
>I'd like to open up a standard Intuition window in a custom screen, and use
>any color I choose for the border.  Is this possible?  I tried using
>SetAPen and SetBPen and SetOlPen on the screen's RastPort, but none of
>these worked to make the entire border one nice lovely color.  It always
>comes up using color register 1.

The NewWindow structure has a pair of fields called "DetailPen" and
"BlockPen".  The block pen is used to render (among other things)
the window border and any proportional gadget autoknobs.  The DetailPen
is used for the window title lettering and horizontal stripes in the
drag bar, and for the container of proportional gadgets.  Set these
values to your desired colors and you'll be in business.  If either
value is set to -1, the value will be taken from the DetailPen or
BlockPen value you can establish for your screen by setting those
fields of a NewScreen structure.

SetAPen(), SetBPen(), and SetOPen() affect many graphics.library
rendering commands.  Rendering done through Intuition typically
gets its color values from structures like IntuiTexts, Borders,
NewWindows (well, really Windows by the time it's drawn), etc.

>I couldn't find this in the RKM's;
>perhaps I'm just dense...  Thanks for any help...

It's in there, but hey, this is no small book :-)

>-Mike Schwager

     Peter
--
     Peter Cherna, Software Engineer, Commodore-Amiga, Inc.
     {uunet|rutgers}!cbmvax!peter    peter@cbmvax.cbm.commodore.com
My opinions do not necessarily represent the opinions of my employer.