f



How to use backing store while using object graphics?

I don't know how to let IDL back store the display, note that I've
written "device, retain=2" in the IDL_startup.pro file, and it works
fine while using direct graphics.

Here is an example,

PRO test_gui
  COMPILE_OPT, IDL2
  mywindow = OBJ_NEW('IDLgrWindow')  ;;retain=2
  myview = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[0, 0, 19, 19])
  mymodel = OBJ_NEW('IDLgrModel')
  data = DIST(20)
  mycontour = OBJ_NEW('IDLgrContour', data, COLOR=[100, 150, 200], $
   C_LINESTYLE=[0, 2, 4], /PLANAR, GEOMZ=0, C_VALUE=INDGEN(20))
  myview->Add, mymodel
  mymodel->Add, mycontour       ;how to set backup storage?
  mywindow->Draw, myview
END

The display will disappear while overlay, minimize and maximize the
window, the "device, retain=2" command doesn't work any more. How to
fix it?

Thanks

0
zhuangbao (19)
6/10/2007 2:00:39 AM
comp.lang.idl-pvwave 12260 articles. 4 followers. Post Follow

6 Replies
784 Views

Similar Articles

[PageSpeed] 37


I would recommend using either
mywindow = OBJ_NEW('IDLgrWindow',RETAIN=2)
or
PREF_SET, 'IDL_GR_WIN_RETAIN', 2


Robbie




0
retsil (153)
6/10/2007 2:25:08 AM
Robert Chuang writes:

> I don't know how to let IDL back store the display, note that I've
> written "device, retain=2" in the IDL_startup.pro file, and it works
> fine while using direct graphics.
> 
> Here is an example,
> 
> PRO test_gui
>   COMPILE_OPT, IDL2
>   mywindow = OBJ_NEW('IDLgrWindow')  ;;retain=2
>   myview = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[0, 0, 19, 19])
>   mymodel = OBJ_NEW('IDLgrModel')
>   data = DIST(20)
>   mycontour = OBJ_NEW('IDLgrContour', data, COLOR=[100, 150, 200], $
>    C_LINESTYLE=[0, 2, 4], /PLANAR, GEOMZ=0, C_VALUE=INDGEN(20))
>   myview->Add, mymodel
>   mymodel->Add, mycontour       ;how to set backup storage?
>   mywindow->Draw, myview
> END
> 
> The display will disappear while overlay, minimize and maximize the
> window, the "device, retain=2" command doesn't work any more. How to
> fix it?

It is exceedingly rare (this is the only program I've
ever seen that did it!) to see an object graphics program
that doesn't draw into a draw widget window. So, normally, 
this problem is solved by turning EXPOSE events on for
the draw widget and then just drawing the view in the
draw widget event handler when the window is "exposed".

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
news2122 (4023)
6/10/2007 2:36:55 AM
Robbie writes:

> I would recommend using either
> mywindow = OBJ_NEW('IDLgrWindow',RETAIN=2)

This didn't work for me when I maximized or
minimized my window on Windows XP with IDL 6.4.
Nor did DEVICE, RETAIN=2. I don't know why. :-(

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
news2122 (4023)
6/10/2007 2:41:15 AM
On Jun 10, 10:41 am, David Fanning <n...@dfanning.com> wrote:
> Robbie writes:
> > I would recommend using either
> > mywindow = OBJ_NEW('IDLgrWindow',RETAIN=2)
>
> This didn't work for me when I maximized or
> minimized my window on Windows XP with IDL 6.4.
> Nor did DEVICE, RETAIN=2. I don't know why. :-(
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

It didn't work on my ubuntu 6.10,too.
I am afraid there is no method to solve this.
Could you give me an example of rewriting this code using widget_draw?

0
zhuangbao (19)
6/10/2007 3:41:32 AM
Robert Chuang writes:

> It didn't work on my ubuntu 6.10,too.
> I am afraid there is no method to solve this.
> Could you give me an example of rewriting this code using widget_draw?

Well, I explained a method to solve it. You can look
at any object graphics program on my web page to see
it solved in action! I'd start with something like XPLOT
for something easy:

   http://www.dfanning.com/programs/xplot.pro

Look at the XPLOT_DRAW_WIDGET_EVENTS module.

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
news2122 (4023)
6/10/2007 3:49:49 AM
On Jun 10, 11:00 am, Robert Chuang <zhuang...@gmail.com> wrote:
> I don't know how to let IDL back store the display, note that I've
> written "device, retain=2" in the IDL_startup.pro file, and it works
> fine while using direct graphics.
>
> Here is an example,
>
> PRO test_gui
>   COMPILE_OPT, IDL2
>   mywindow = OBJ_NEW('IDLgrWindow')  ;;retain=2
>   myview = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[0, 0, 19, 19])
>   mymodel = OBJ_NEW('IDLgrModel')
>   data = DIST(20)
>   mycontour = OBJ_NEW('IDLgrContour', data, COLOR=[100, 150, 200], $
>    C_LINESTYLE=[0, 2, 4], /PLANAR, GEOMZ=0, C_VALUE=INDGEN(20))
>   myview->Add, mymodel
>   mymodel->Add, mycontour       ;how to set backup storage?
>   mywindow->Draw, myview
> END
>
> The display will disappear while overlay, minimize and maximize the
> window, the "device, retain=2" command doesn't work any more. How to
> fix it?
>
> Thanks

Robert,
It works for me..If I understand the problem correctly - i.e., while
overlaying or minimizing or maximizing the window, the contours don't
disappear :P I was going to attach 2 screenshots for your viewing
pleasure (one of them advertises David's ebook - which I bought
recently- too ;-) ), but I guess I can't abuse usenet :)

 I usually do this backing store thingy within my xconfig. Within the /
etc/X11/xorg.conf (Section "Device"), I add the following above the
'EndSection' instead of .idlrc...
----------------------------------------------
Option          "BACKING STORE"         "TRUE"
----------------------------------------------
Hth,
/metachronist

0
rkombiyil (60)
6/10/2007 3:07:05 PM
Reply: