comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: background color for draw widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: background color for draw widget [message #60734] Fri, 06 June 2008 09:20
cgoethel is currently offline  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 Go to previous message
cgoethel is currently offline  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 Go to previous message
Paul Van Delst[1] is currently offline  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 Go to previous message
ben.bighair is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: GUI in IDL 7
Next Topic: Array indexing: what is IDL doing?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:39:33 PDT 2025

Total time taken to generate the page: 0.00521 seconds