[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Background color in raster widgets...
From: |
Sven N. Thommesen |
Subject: |
Re: Background color in raster widgets... |
Date: |
Tue, 07 Jan 1997 13:52:16 -0600 |
At 11:20 AM 1/7/97 -0700, Barry McMullin wrote:
>
>I had exactly the same problem (of wanting a white
>rather than black background) and for the same reasons
>(making hardcopy, especially in monochrome). I did not
>search too hard for the "right" way to do it (if there
>is one!) but just resorted to:
>
>
> [worldRaster fillRectangleX0: 0 Y0: 0
> X1: ([world getSizeX] * 8) Y1: ([world getSizeY] * 8)
> Color: backgroundColor];
>
>I use this in place of [worldRaster erase];
>backgroundColor is an index into the colormap
>(which I have elsewhere set to white - but it
>could be anything).
>
>You might be concerned that there will be a serious
>performance hit compared to using erase - but I think
>the code behind erase is effectively identical.
>
>Ignore the "* 8" on the sizes here - it just reflects a
>scaling between the agent space and the raster in my
>particular model.
>
>Hope that helps.
>
>
>Barry.
>
Barry,
Thanks! But I'd just like to know where you call that one from!
To be useful, it would need to be called once every time step,
which I tried to do, without success, with [worldRaster erase].
The problem: putting your method call in buildActions does not work,
because createActionTo: takes a maximum of 3 arguments ... :-(
Any hints?
Sven