X
3380

Creating an IDL Clipboard Object Identical to the original Window


How to make an exact copy of an IDLgrWindow object on the Windows clipboard?

Setting several properties of the clipboard object to the same values as the Window object will ensure that the resulting clipboard object looks identical to the original.

The DIMENSIONS, UNITS, RESOLUTION, COLOR_MODEL, and N_COLORS properties of your clipboard object need to be set to the values returned by the GETPROPERTY method called on the window you wish to copy.

Here is an example code fragment that will demonstrate how to do this:
'CLIPBOARD' : begin
widget_control, ev.top, GET_UVALUE=state, /NO_COPY
state.win->getproperty, DIMENSIONS=wdims, RESOLUTION=res,$
COLOR_MODEL=cm, N_COLORS=icolors, UNITS=uts
oClipboard = obj_new('IDLgrClipboard', DIMENSIONS=wdims, $
RESOLUTION=res, COLOR_MODEL=cm, N_COLORS=icolors, $
UNITS=uts
oClipboard->draw, state.v
obj_destroy, oClipboard
widget_control, ev.top, SET_UVALUE=state, /NO_COPY
end