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

Home » Public Forums » archive » Printing a collection of widget items
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
Printing a collection of widget items [message #49502] Tue, 01 August 2006 13:19 Go to next message
Ryan. is currently offline  Ryan.
Messages: 77
Registered: March 2006
Member
Dear All,

I have one window with a collection of button, text, draw and label
widgets (in one base widget) and would like to know if there is a way
of printing it. I tried to get the value (id) of the base widget to
try to use David Fanning's TVREAD routine, but you cannot call the
get_value parameter on a widget_base. Has anyone been able to do this
or does anyone know what the correct way to do it? My routine is quite
lengthy because there are so many widgets so I will not include it but
I can put it up if you would like. Thanks.

Ryan.
Re: Printing a collection of widget items [message #49559 is a reply to message #49502] Thu, 03 August 2006 08:30 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Michael A. Miller wrote:
>
> Here's a procedure that uses import (from ImageMagick) to capture
> a top level base.

That's very useful, thanks!

> 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?)
>

It looks like WIDGET_CONTROL is lacking a TLB_GET_TITLE keyword. But I
usually keep track of the title internally, since I change it
(TLB_SET_TITLE) sometimes.

What happens if the title is not unique? Will it capture the window in
the foreground?

It looks like import works only for X Windows. But I found out that
Irfanview can also run in command-line mode to do the same on MS Windows.

Thanks,
Benjamin
Re: Printing a collection of widget items [message #49560 is a reply to message #49502] Thu, 03 August 2006 07:27 Go to previous messageGo to next message
mmiller3 is currently offline  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
Re: Printing a collection of widget items [message #49631 is a reply to message #49559] Fri, 04 August 2006 10:15 Go to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
Benjamin Hornberger wrote:

> What happens if the title is not unique? Will it capture the window in
> the foreground?

I think it will capture the foremost window. If you've selected
another window with the same title, I think you'll get that one.

> It looks like import works only for X Windows. But I found out that
> Irfanview can also run in command-line mode to do the same on MS Windows.

That's good to know!

Mike
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ellipsoid 3D
Next Topic: Re: Reading in a postscript file into IDL

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

Current Time: Wed Oct 08 11:37:37 PDT 2025

Total time taken to generate the page: 0.00861 seconds