Re: Printing a collection of widget items [message #49560 is a reply to message #49502] |
Thu, 03 August 2006 07:27  |
mmiller3
Messages: 81 Registered: January 2002
|
Member |
|
|
>>>> > "Ryan" == Ryan <rchughes@brutus.uwaterloo.ca> writes:
> Thanks for your response but all my draw widgets are
> indicator lights (only 1 of 5 colors) for about 30
> different things so putting the labels on manually would
> not be feasible. It would be better for me to spend my
> time writing something where all the indicators are written
> directly to a postscript file. I am using IDL on UNIX and
> have the plotting set to X windows. Thanks for the
> suggestion though.
Ryan,
Here's a procedure that uses import (from ImageMagick) to capture
a top level base. It helps to know the title of the base widget
as well as the widget id - then it is entirely automatic.
Otherwise you'll need to select the window with the mouse. (does
anyone know how to get the title of a base widget in IDL?)
Note that the type of file that you are capturing to is
determined by the extension of the filename: .ps for postscript,
.pdf for pdf, .jpg for jpeg, and so on.
Hope this helps, Mike
pro import_tlb, widget_id, filename, title=title
;; Bring the widget to the front:
widget_control, widget_id, iconify=0
;; If we know the window title, then capture it directly, otherwise
;; use what the user selects:
if n_elements(title) eq 1 then begin
cmnd = 'import -screen -window "' + title + '" ' + filename
endif else begin
cmnd = 'import -screen ' + filename
endelse
spawn, cmnd, result
print, result
end
--
Michael A. Miller mmiller3@iupui.edu
Imaging Sciences, Department of Radiology, IU School of Medicine
|
|
|