Why is the content of my object graphics window being wiped? [message #84818] |
Wed, 12 June 2013 05:24  |
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 #84821 is a reply to message #84820] |
Wed, 12 June 2013 05:57   |
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   |
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 #84860 is a reply to message #84840] |
Fri, 14 June 2013 11:13   |
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  |
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
|
|
|