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

Home » Public Forums » archive » Why is the content of my object graphics window being wiped?
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
Why is the content of my object graphics window being wiped? [message #84818] Wed, 12 June 2013 05:24 Go to next message
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
Hi there. I've been looking into using object windows to display object graphics. I have successfully written a routine that draws the Mandelbrot set on the screen. The problem I have is that if I minimize the window and then restore it, the contents of the object window are gone. Equally, if I move the window so that some of it is off the side of my screen, and then move it back, the content that was off the screen is also wiped. I can issue another "draw" command to the object so that it comes back, but this is a bit clumsy. I suspect there is a command that I don't know about that will automatically redraw the object for me - does anyone know what it is?

This simple example illustrates my point:

; Create a destination object, in this case a window:
oWindow = OBJ_NEW('IDLgrWindow')
; Create a viewport that fills the entire window:
oView = OBJ_NEW('IDLgrView')

; Set the color property of the view:
oView->SetProperty, COLOR=[255,0,0]
; Redraw:
oWindow->Draw, oView

If you minimize the window, and then restore it the red has been replaced with black. Equally, if you were to drag the window off the edge of the screen the red is replaced with black.

Thanks for your help,

David
Re: Why is the content of my object graphics window being wiped? [message #84819 is a reply to message #84818] Wed, 12 June 2013 05:31 Go to previous messageGo to next message
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
I should have said that I'm using IDL 6.4, on Windows XP Professional 32-bit.
Re: Why is the content of my object graphics window being wiped? [message #84820 is a reply to message #84818] Wed, 12 June 2013 05:35 Go to previous messageGo to next message
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
OK - I've solved it. I have had to change the backing store setting in the IDL graphics preferences. Setting this to "Bitmap buffered, RETAIN=2" has fixed the problem.

Thanks,

David
Re: Why is the content of my object graphics window being wiped? [message #84821 is a reply to message #84820] Wed, 12 June 2013 05:57 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Platten writes:

> OK - I've solved it. I have had to change the backing store setting in the IDL graphics preferences. Setting this to "Bitmap buffered, RETAIN=2" has fixed the problem.

If you want this program to work on machines (e.g., running LINUX) that
treat RETAIN=2 as an onerous command from one of their parents that is
safe to ignore, then the other, probably preferred, alternative is to
set expose events on your draw widget and then to simply redraw the
graphics hierarchy in this case. I've always thought of this one-line
command as "elegant" rather than "clumsy", but I guess beauty is in the
eye of the beholder. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Why is the content of my object graphics window being wiped? [message #84834 is a reply to message #84818] Wed, 12 June 2013 12:55 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
I'm having a similar problem, but with Function graphics.

I've gotten an nVidia driver installed (which apparently doesn't play
nice with RHEL6). Could that be the cause of the problem?

How does one set the FG equivalent of RETAIN=2?

cheers,

paulv



On 06/12/13 08:24, David Platten wrote:
> Hi there. I've been looking into using object windows to display
> object graphics. I have successfully written a routine that draws the
> Mandelbrot set on the screen. The problem I have is that if I
> minimize the window and then restore it, the contents of the object
> window are gone. Equally, if I move the window so that some of it is
> off the side of my screen, and then move it back, the content that
> was off the screen is also wiped. I can issue another "draw" command
> to the object so that it comes back, but this is a bit clumsy. I
> suspect there is a command that I don't know about that will
> automatically redraw the object for me - does anyone know what it
> is?
>
> This simple example illustrates my point:
>
> ; Create a destination object, in this case a window: oWindow =
> OBJ_NEW('IDLgrWindow') ; Create a viewport that fills the entire
> window: oView = OBJ_NEW('IDLgrView')
>
> ; Set the color property of the view: oView->SetProperty,
> COLOR=[255,0,0] ; Redraw: oWindow->Draw, oView
>
> If you minimize the window, and then restore it the red has been
> replaced with black. Equally, if you were to drag the window off the
> edge of the screen the red is replaced with black.
>
> Thanks for your help,
>
> David
>
Re: Why is the content of my object graphics window being wiped? [message #84835 is a reply to message #84834] Wed, 12 June 2013 13:13 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> I'm having a similar problem, but with Function graphics.
>
> I've gotten an nVidia driver installed (which apparently doesn't play
> nice with RHEL6). Could that be the cause of the problem?
>
> How does one set the FG equivalent of RETAIN=2?

Really!? Can you show me an example of what you mean? I wouldn't have
though FG needed any retaining. I would have thought this was all being
handled via expose events. RETAIN is just going to get you into all
kinds of trouble.

I'd be very curious to see what the problem looks like and what commands
produce it.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Why is the content of my object graphics window being wiped? [message #84840 is a reply to message #84835] Wed, 12 June 2013 15:35 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 06/12/13 16:13, David Fanning wrote:
> Paul van Delst writes:
>
>> I'm having a similar problem, but with Function graphics.
>>
>> I've gotten an nVidia driver installed (which apparently doesn't play
>> nice with RHEL6). Could that be the cause of the problem?
>>
>> How does one set the FG equivalent of RETAIN=2?
>
> Really!? Can you show me an example of what you mean? I wouldn't have
> though FG needed any retaining. I would have thought this was all being
> handled via expose events. RETAIN is just going to get you into all
> kinds of trouble.

Sure. Take a look at:
http://ftp.emc.ncep.noaa.gov/jcsda/CRTM/.plots/Screenshot.pn g

> I'd be very curious to see what the problem looks like and what commands
> produce it.

I think the offender is
q = get_kbrd(1)
but that's not an issue for DG window refresh/retain and I can't recall
it being an issue for FG in the past either. I pause to peruse and
compare FG plots all the time.

As far as I can remember (it did take an entire month to get IDL
reinstalled on my "upgraded" computer) this is new behaviour. Whether
it's caused by IDL v8.2.2 or by the use of the nVidia driver in RHEL6 --
or some unholy combination of the two -- I'm trying to figure out.

cheers,

paulv
Re: Why is the content of my object graphics window being wiped? [message #84841 is a reply to message #84840] Wed, 12 June 2013 15:46 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> Sure. Take a look at:
> http://ftp.emc.ncep.noaa.gov/jcsda/CRTM/.plots/Screenshot.pn g

Yikes!

> I think the offender is
> q = get_kbrd(1)
> but that's not an issue for DG window refresh/retain and I can't recall
> it being an issue for FG in the past either. I pause to peruse and
> compare FG plots all the time.

Ah, this I can believe. :-)

If I interrupt widget programs, I can get this same sort of odd
behavior. I don't think FG windows are IDL widgets (am I mistaken?), but
I can imagine them going bonkers when they get interrupted. Maybe they
can't recover to handle the window expose event.

Very strange. Maybe Coyote Graphics will stick around longer than I
expected it to. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Why is the content of my object graphics window being wiped? [message #84843 is a reply to message #84821] Thu, 13 June 2013 01:01 Go to previous messageGo to next message
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
Hi David,

Many thanks for your reply - I didn't know about the EXPOSE_EVENTS or RETAIN options for my draw widget. I was setting RETAIN=2 in the IDE preferences, not in my draw widget.

I have now switched on EXPOSE_EVENTS and have set RETAIN=0 in my draw widget, and changed the event handler to deal with the expose events that are generated. Everything is working well.

Regards,

David
Re: Why is the content of my object graphics window being wiped? [message #84860 is a reply to message #84840] Fri, 14 June 2013 11:13 Go to previous messageGo to next message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Wednesday, June 12, 2013 4:35:01 PM UTC-6, Paul van Delst wrote:
> On 06/12/13 16:13, David Fanning wrote:
>
>> Paul van Delst writes:
>
>>
>
>>> I'm having a similar problem, but with Function graphics.
>
>>>
>
>>> I've gotten an nVidia driver installed (which apparently doesn't play
>
>>> nice with RHEL6). Could that be the cause of the problem?
>
>>>
>
>>> How does one set the FG equivalent of RETAIN=2?
>
>>
>
>> Really!? Can you show me an example of what you mean? I wouldn't have
>
>> though FG needed any retaining. I would have thought this was all being
>
>> handled via expose events. RETAIN is just going to get you into all
>
>> kinds of trouble.
>
>
>
> Sure. Take a look at:
>
> http://ftp.emc.ncep.noaa.gov/jcsda/CRTM/.plots/Screenshot.pn g
>
>
>
>> I'd be very curious to see what the problem looks like and what commands
>
>> produce it.
>
>
>
> I think the offender is
>
> q = get_kbrd(1)
>
> but that's not an issue for DG window refresh/retain and I can't recall
>
> it being an issue for FG in the past either. I pause to peruse and
>
> compare FG plots all the time.
>
>
>
> As far as I can remember (it did take an entire month to get IDL
>
> reinstalled on my "upgraded" computer) this is new behaviour. Whether
>
> it's caused by IDL v8.2.2 or by the use of the nVidia driver in RHEL6 --
>
> or some unholy combination of the two -- I'm trying to figure out.
>
>
>
> cheers,
>
>
>
> paulv

Hi Paul,

When called from the command line, NG are widget programs. So, on UNIX-based systems, if you're stopped inside a routine, the NG window won't get the expose event until you .continue the interpreter. There's a related issue when using NG in the Workbench which we're looking at repairing in IDL 8.3. We may also look at this for NG called from the command line.

I would like to get this fixed because it's key to be able to visually explore data with IDL.

mp
Re: Why is the content of my object graphics window being wiped? [message #84876 is a reply to message #84860] Sat, 15 June 2013 03:29 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
+1 for a fix from me. It's not a show-stopper but an annoyance in debugging programs. Haje

On Friday, June 14, 2013 2:13:08 PM UTC-4, Mark Piper wrote:
> On Wednesday, June 12, 2013 4:35:01 PM UTC-6, Paul van Delst wrote:
>
>> On 06/12/13 16:13, David Fanning wrote:
>
>>
>
>>> Paul van Delst writes:
>
>>
>
>>>
>
>>
>
>>>> I'm having a similar problem, but with Function graphics.
>
>>
>
>>>>
>
>>
>
>>>> I've gotten an nVidia driver installed (which apparently doesn't play
>
>>
>
>>>> nice with RHEL6). Could that be the cause of the problem?
>
>>
>
>>>>
>
>>
>
>>>> How does one set the FG equivalent of RETAIN=2?
>
>>
>
>>>
>
>>
>
>>> Really!? Can you show me an example of what you mean? I wouldn't have
>
>>
>
>>> though FG needed any retaining. I would have thought this was all being
>
>>
>
>>> handled via expose events. RETAIN is just going to get you into all
>
>>
>
>>> kinds of trouble.
>
>>
>
>>
>
>>
>
>> Sure. Take a look at:
>
>>
>
>> http://ftp.emc.ncep.noaa.gov/jcsda/CRTM/.plots/Screenshot.pn g
>
>>
>
>>
>
>>
>
>>> I'd be very curious to see what the problem looks like and what commands
>
>>
>
>>> produce it.
>
>>
>
>>
>
>>
>
>> I think the offender is
>
>>
>
>> q = get_kbrd(1)
>
>>
>
>> but that's not an issue for DG window refresh/retain and I can't recall
>
>>
>
>> it being an issue for FG in the past either. I pause to peruse and
>
>>
>
>> compare FG plots all the time.
>
>>
>
>>
>
>>
>
>> As far as I can remember (it did take an entire month to get IDL
>
>>
>
>> reinstalled on my "upgraded" computer) this is new behaviour. Whether
>
>>
>
>> it's caused by IDL v8.2.2 or by the use of the nVidia driver in RHEL6 --
>
>>
>
>> or some unholy combination of the two -- I'm trying to figure out.
>
>>
>
>>
>
>>
>
>> cheers,
>
>>
>
>>
>
>>
>
>> paulv
>
>
>
> Hi Paul,
>
>
>
> When called from the command line, NG are widget programs. So, on UNIX-based systems, if you're stopped inside a routine, the NG window won't get the expose event until you .continue the interpreter. There's a related issue when using NG in the Workbench which we're looking at repairing in IDL 8.3. We may also look at this for NG called from the command line.
>
>
>
> I would like to get this fixed because it's key to be able to visually explore data with IDL.
>
>
>
> mp
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: spacing between characters
Next Topic: cgHistogram - logarithmic y-axis with integer values

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

Current Time: Wed Oct 08 15:33:19 PDT 2025

Total time taken to generate the page: 0.00464 seconds