Re: background color for draw widget [message #60734] |
Fri, 06 June 2008 09:20 |
cgoethel
Messages: 20 Registered: April 2008
|
Junior Member |
|
|
On Jun 6, 8:51 am, "ben.bighair" <ben.bigh...@gmail.com> wrote:
> On Jun 6, 10:16 am, cgoet...@igpp.ucla.edu wrote:
>
>> Hi All, When I create a simple draw widget, the background color
>> defaults to black. How do I change that to a light grey? Thanks for
>> your help! Cindy
>
> Hi,
>
> The simplest way is to call ERASE since the draw widget contains a
> regular old window. For example, if you are using direct graphics
> you might do the following....
>
> WIDGET_CONTROL, myDrawID, GET_VALUE = winID
> WSET, winID
> ERASE, somecolor
>
> Depending upon how you set up backing store, you might need to refresh
> this as the window gets covered/uncovered. Sometimes it is best to
> let the system or IDL do that for you. BUT you have to be thoughtful
> about this method as it won't work if you intend to ever use your
> plotting code on a device other than a window (for example, ERASE
> starts a new page or something like that on the PRINTER device.] If
> you want it to be device independent you might use...
>
> POLYFILL, [-0.01, -0.01, 1.1, 1.1, -0.01], [-0.01, 1.1, 1.1, -0.01,
> -0.01], /NORM, COLOR = somecolor
>
> which will draw a box of "somecolor" value over then entire window
> (plus enough to lap over the edges).
>
> Cheers,
> Ben
Thanks! This is very helpful. I do want it to be platform
independent, so I'll try the POLYFILL method.
|
|
|
Re: background color for draw widget [message #60735 is a reply to message #60734] |
Fri, 06 June 2008 09:19  |
cgoethel
Messages: 20 Registered: April 2008
|
Junior Member |
|
|
On Jun 6, 9:11 am, Paul van Delst <Paul.vanDe...@noaa.gov> wrote:
> ben.bighair wrote:
>> On Jun 6, 10:16 am, cgoet...@igpp.ucla.edu wrote:
>>> Hi All, When I create a simple draw widget, the background color
>>> defaults to black. How do I change that to a light grey? Thanks for
>>> your help! Cindy
>
>> Hi,
>
>> The simplest way is to call ERASE since the draw widget contains a
>> regular old window. For example, if you are using direct graphics
>> you might do the following....
>
>> WIDGET_CONTROL, myDrawID, GET_VALUE = winID
>> WSET, winID
>> ERASE, somecolor
>
>> Depending upon how you set up backing store, you might need to refresh
>> this as the window gets covered/uncovered. Sometimes it is best to
>> let the system or IDL do that for you. BUT you have to be thoughtful
>> about this method as it won't work if you intend to ever use your
>> plotting code on a device other than a window (for example, ERASE
>> starts a new page or something like that on the PRINTER device.] If
>> you want it to be device independent you might use...
>
>> POLYFILL, [-0.01, -0.01, 1.1, 1.1, -0.01], [-0.01, 1.1, 1.1, -0.01,
>> -0.01], /NORM, COLOR = somecolor
>
>> which will draw a box of "somecolor" value over then entire window
>> (plus enough to lap over the edges).
>
> Can't you just set !P.BACKGROUND to some other colour?
>
> cheers,
>
> paulv
Thanks! I'll give it a try.
|
|
|
Re: background color for draw widget [message #60736 is a reply to message #60735] |
Fri, 06 June 2008 09:11  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
ben.bighair wrote:
> On Jun 6, 10:16 am, cgoet...@igpp.ucla.edu wrote:
>> Hi All, When I create a simple draw widget, the background color
>> defaults to black. How do I change that to a light grey? Thanks for
>> your help! Cindy
>
> Hi,
>
> The simplest way is to call ERASE since the draw widget contains a
> regular old window. For example, if you are using direct graphics
> you might do the following....
>
> WIDGET_CONTROL, myDrawID, GET_VALUE = winID
> WSET, winID
> ERASE, somecolor
>
> Depending upon how you set up backing store, you might need to refresh
> this as the window gets covered/uncovered. Sometimes it is best to
> let the system or IDL do that for you. BUT you have to be thoughtful
> about this method as it won't work if you intend to ever use your
> plotting code on a device other than a window (for example, ERASE
> starts a new page or something like that on the PRINTER device.] If
> you want it to be device independent you might use...
>
> POLYFILL, [-0.01, -0.01, 1.1, 1.1, -0.01], [-0.01, 1.1, 1.1, -0.01,
> -0.01], /NORM, COLOR = somecolor
>
> which will draw a box of "somecolor" value over then entire window
> (plus enough to lap over the edges).
Can't you just set !P.BACKGROUND to some other colour?
cheers,
paulv
|
|
|
Re: background color for draw widget [message #60738 is a reply to message #60736] |
Fri, 06 June 2008 08:51  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On Jun 6, 10:16 am, cgoet...@igpp.ucla.edu wrote:
> Hi All, When I create a simple draw widget, the background color
> defaults to black. How do I change that to a light grey? Thanks for
> your help! Cindy
Hi,
The simplest way is to call ERASE since the draw widget contains a
regular old window. For example, if you are using direct graphics
you might do the following....
WIDGET_CONTROL, myDrawID, GET_VALUE = winID
WSET, winID
ERASE, somecolor
Depending upon how you set up backing store, you might need to refresh
this as the window gets covered/uncovered. Sometimes it is best to
let the system or IDL do that for you. BUT you have to be thoughtful
about this method as it won't work if you intend to ever use your
plotting code on a device other than a window (for example, ERASE
starts a new page or something like that on the PRINTER device.] If
you want it to be device independent you might use...
POLYFILL, [-0.01, -0.01, 1.1, 1.1, -0.01], [-0.01, 1.1, 1.1, -0.01,
-0.01], /NORM, COLOR = somecolor
which will draw a box of "somecolor" value over then entire window
(plus enough to lap over the edges).
Cheers,
Ben
|
|
|