Page 1 of 1

Setting Canvas background color

Posted: Sat Jun 22, 2013 12:38 am
by ken_anthony
I always search for the answer before asking questions but only found...

SetGadgetAttribute

But could not find the attribute constant required to set the background color anywhere.

So forgive me for asking, but could somebody tell me the proper constant? Thanks.

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 12:54 am
by Demivec
ken_anthony wrote:I always search for the answer before asking questions but only found...

SetGadgetAttribute

But could not find the attribute constant required to set the background color anywhere.

So forgive me for asking, but could somebody tell me the proper constant? Thanks.
The canvas gadget doesn't have a background attribute, you can draw it yourself with a Box().

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 12:55 am
by Bisonte
Background Color of a Canvas ? with SetGadgetAttribute ?

Never saw that. Normally its like

Code: Select all

StartDrawing(CanvasOutput(Gadget))
Box(0, 0, OutputWidth(), OutputHeight(), Color)
StopDrawing()

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 1:16 am
by ken_anthony
That worked. Well, after I figured out why it wasn't working since I resized from zero to the parent height and width (it's always something, isn't it?)

Thanks a huge bunch.

ken

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 1:49 am
by Demivec
Your welcome. :)

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 5:13 am
by PB
> SetGadgetAttribute()

The command for setting gadget colors is SetGadgetColor().
When you look up this command in the Help manual, you'll
see that the canvas gadget doesn't support this command.

Also, when you look up the canvas gadget in the Help manual,
you'll see a list of attibutes (constants) that it supports. There
is no attribute for setting the color, for this or any other gadget.

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 8:41 am
by bobobo
a Canvas ist a thing to draw on , nearly like in real life, where you can buy colored canvases. :D

Re: Setting Canvas background color

Posted: Sat Jun 22, 2013 8:45 am
by ken_anthony
Thank you all. I'm very impressed by the responses I've received. You are certainly a good group of people.