C (83/178)

From:Nick Lamburn
Date:21 Jul 2000 at 00:54:51
Subject:Re: Creating a button gadget with BOOPSI

On 20-Jul-00, Gabriele Svelto wrote:

> Hello everybody,
> there's been a lot of talking around BOOPSI and OOP in general, now a
> simpler question: I wished to make an ultra-simple button gadget with
> BOOPSI and used the following code to create the object
>
> /* win is a pointer to the window containing the gadget, border is an
> initialized Border structure */
>

VVVVVVVVVVVV
> gad = (struct Gadget *) NewObject(NULL, *GADGETCLASS,*
> GA_Left, win->BorderLeft + 5,
> GA_Top, win->BorderTop + 5,
> GA_Width, 64,
> GA_Height, 64,
> GA_Border, &border,
> GA_Highlight, GFLG_GADGHCOMP,
> GA_Immediate, TRUE,
> GA_RelVerify, TRUE,
> TAG_DONE);
>
> then I added it to the window and refreshed the whole gadget list, result:
> nothing. I cannot even see the imagery!? What's wrong with this code? I've
> read the BOOPSI section in the RKM carefully but haven't found a clue...
> Thanx in advance for any help with this, see ya

GADGETCLASS should be "frbuttongclass", e.g.:

gad = (struct Gadget *) NewObject(NULL, **"frbuttongclass"*,*
GA_Left, win->BorderLeft + 5,
GA_Top, win->BorderTop + 5,
GA_Width, 64,
GA_Height, 64,
GA_Border, &border,
GA_Highlight, GFLG_GADGHCOMP,
GA_Immediate, TRUE,
GA_RelVerify, TRUE,
TAG_DONE);

Simple mistake :)

Regards



Nick Lamburn - Dept. Manager of Trogladite Software
---------------------------------------------------------------------
oruk_amigan@btinternet.com http://www.trogsoft.org

------------------------------------------------------------------------
It's the End Of The Line for My Shipping Broker.
http://click.egroups.com/1/5175/1/_/451227/_/964133712/
------------------------------------------------------------------------