Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!brl-adm!rutgers!mit-eddie!genrad!decvax!decwrl!labrea!navajo!ali
From: ali@navajo.STANFORD.EDU (Ali Ozer)
Newsgroups: comp.sys.amiga
Subject: I need help with proportional gadgets!
Message-ID: <1216@navajo.STANFORD.EDU>
Date: Sun, 14-Dec-86 18:37:18 EST
Article-I.D.: navajo.1216
Posted: Sun Dec 14 18:37:18 1986
Date-Received: Tue, 16-Dec-86 18:38:04 EST
Reply-To: ali@navajo.ARPA (Ali Ozer)
Distribution: na
Organization: Stanford University
Lines: 46

Keywords:


[=====:-(===========]   

Ok... Here's a question about proportional gadgets. Problem: I'm having
a hard time getting them to work right for me.  Maybe I should be using
EGad, but, sigh, I don't have it yet... Anyway, I have the following
piece of code.  I initialize my proportional gadget using InitGadgets()
below. The problem is, the select box of the gadget is not the same as
my background color. Also, when I select the knob, the knob is complemented,
although I am specifying no highlighting. Furthermore, as I move the
gadget around slowly, it erases the background color. But, if I move
it quickly, it erases it, but not perfectly --- It leaves patches of
it behind. 

-------
/* I don't initialize this image --- The Intuition Manual says "don't
   initialize it when using AutoKnob." I wonder why we even need it?  */
static struct Image InvPropImage;

/* I initialize this PropInfo during runtime, in InitGadgets() */
static struct PropInfo InvBoxPInfo;

static struct Gadget InvBoxGadget = {
  NULL /* No next */,
  (SHORT)X1, (SHORT)Y1, (SHORT)INVBOXWIDTH, (SHORT)INVBOXHEIGHT,
  GADGHNONE | GADGDISABLED, RELVERIFY,
  PROPGADGET, (APTR)(&InvPropImage), 
  NULL, NULL, NULL, (APTR)(&InvBoxPInfo), INVBOXID, NULL};

InitGadgets ()
{
  InvBoxPInfo.Flags = (AUTOKNOB | FREEVERT | PROPBORDERLESS); 
  InvBoxPInfo.VertBody = 0x1000;         
  InvBoxPInfo.HorizBody = 0xffff;       
  AddGadget (win, &InvBoxGadget, -1L);   /* win is my window */
  OnGadget (&InvBoxGadget, win, NULL);     
}

In summary: My gadget's select box is filled with some color, but I want
it the same as color 0. (I even tried setting pen colors to 0 before
doing the OnGadget... No use.) When I move the knob around, it erases
this background color, but if move it too quickly, it doesn't erase it
completely. Also, the knob is highlighted when selected. I don't want that!
What am I doing wrong? Something stupid, I hope. (In case it helps: My screen
is 4 planes deep, I use a backdrop window, & I trap RAWKEY & GADGETUP events.)

Ali Ozer, ali@navajo.stanford.edu