Capturing draw events [message #6351] |
Sat, 22 June 1996 00:00  |
Phil Williams
Messages: 78 Registered: April 1996
|
Member |
|
|
Widget programmers,
I was wondering if anyone out there can help me out with a problem....
Here's the situation. I have a widget with several control panels
created with coumpound widgets. They all have state structures which I
save in the uvalue of the first child of the base. These structures
typically have the ids of any child widgets that I need access to.
When one of these panels is displayed I want to send any draw events to
a different procedure to process the event and update child widgets of
that panel. However, the following does not work:
pro panel_draw_event, draw_event, parent
stash = WIDGET_INFO(parent, /CHILD)
WIDGET_CONTROL, stash, GET_UVALUE=r, /NO_COPY
widget_control, r.textwidgetid, $
set_value=string(draw_event.x) + string(draw_event.y)
WIDGET_CONTROL, stash, SET_UVALUE=r, /NO_COPY
end
From the main widget I pass the event structure and the mainbase id of
the panel from when it was originally created. I have checked
panel_draw_event to make sure that parent was indeed the correct value
and it is. Can I only retrieve the structure r if the handler and the
parent are the same? If so, how can I work around this?
Any pointers would be greatly appreciated...
--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://scuttle.chmcc.org/~williams/
/*********************************************************** ********/
|
|
|
Re: CAPTURING [message #7301 is a reply to message #6351] |
Mon, 04 November 1996 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
> Mario Noyon wrote:
>>
>> Is there a way to capture a whole widget application in an image (in any
>> format gif or ps)?
>> I would like to capture a window with all its elements (buttons, menus,
>> drawing widgets and the plots they contain).
If you're using Solaris, you can use the built-in Snapshot
utility. I've used it to create images of our programs for
publications and for the RSI newsletter. You can specify a
rectangular region of the screen, or grab a particular X-window.
BTW, you can get XV at http://smc.vnet.net/solaris_2.5.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
Re: CAPTURING [message #7303 is a reply to message #6351] |
Sun, 03 November 1996 00:00  |
brian.jackel
Messages: 23 Registered: May 1996
|
Junior Member |
|
|
In article <davidf-ya023080003110961146480001@news.frii.com> davidf@fortnet.org (David Fanning) writes:
> Mario Noyon < mnoyon@jmc-luni.u-bordeaux2.fr> writes:
>> Is there a way to capture a whole widget application in an image (in any
>> format gif or ps)?
>> I would like to capture a window with all its elements (buttons, menus,
>> drawing widgets and the plots they contain).
> On my Macintosh, I use Flash-It 3.0.2 to do a screen capture into PICT
> format. If I want the output in GIF or PS I use GraphicConverter 2.5
> to convert it.
For PC-Windows (WFWG and Win95), one can simply select the widget and hit
Alt-PrintScreen. This puts the current window (the widget) into the clipboard,
which can be pasted into the graphics program of your choice. Of course,
it would be nice to have a platform independent IDL function which would put
the widget into a pixmap...maybe in IDL 5?
Brian Jackel
|
|
|
Re: CAPTURING [message #7320 is a reply to message #6351] |
Thu, 31 October 1996 00:00  |
Christian Soeller
Messages: 46 Registered: August 1996
|
Member |
|
|
Mario Noyon <mnoyon@jmc-luni.u-bordeaux2.fr> writes:
> Is there a way to capture a whole widget application in an image (in any
> format gif or ps)?
> I would like to capture a window with all its elements (buttons, menus,
> drawing widgets and the plots they contain).
There are programs around to do just that. Which is the right one for
you depends on your platform. If you use unix or vms with the X window
system the shareware program xv is one that does it nicely (it is the grab
function in that package). On SGI machines you have the program snapshot
to do it. Other manufactures may ship similar programs with their machines.
There will be equivalents for Windows, Macs, etc.
Hope this helps,
Christian
------------------------------------------------------------ --------
Christian Soeller mailto: csoelle@sghms.ac.uk
St. Georges Hospital Medical School Dept. of Pharmacology
Cranmer Terrace London SW17 0RE
|
|
|
Re: CAPTURING [message #7321 is a reply to message #6351] |
Thu, 31 October 1996 00:00  |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
If you're on an X-windows system, XV is a good way
to capture windows (or parts of windows). It saves in
a number of formats, and is free for educational use.
It will save in gif, ps and a number of other formats.
Tim
Mario Noyon wrote:
>
> Is there a way to capture a whole widget application in an image (in any
> format gif or ps)?
> I would like to capture a window with all its elements (buttons, menus,
> drawing widgets and the plots they contain).
>
> Anyone could help me ?
>
> Thanks in advance.
> --
> NOYON Mario
> Computer Science in Medical imaging
> University of Bordeaux 2
> mnoyon@jmc-luni.u-bordeaux2.fr
|
|
|
Re: CAPTURING [message #7327 is a reply to message #6351] |
Thu, 31 October 1996 00:00  |
Craig DeForest
Messages: 2 Registered: October 1996
|
Junior Member |
|
|
Mario Noyon wrote:
>
> Is there a way to capture a whole widget application in an image (in any
> format gif or ps)?
> I would like to capture a window with all its elements (buttons, menus,
> drawing widgets and the plots they contain).
Use xwd, a free program (which comes with X) that dumps an X window
to a file. It's a real, genuine program, not an IDL routine. You
invoke it from the UNIX command line.
|
|
|
Re: CAPTURING [message #7329 is a reply to message #6351] |
Thu, 31 October 1996 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Mario Noyon < mnoyon@jmc-luni.u-bordeaux2.fr> writes:
> Is there a way to capture a whole widget application in an image (in any
> format gif or ps)?
> I would like to capture a window with all its elements (buttons, menus,
> drawing widgets and the plots they contain).
On my Macintosh, I use Flash-It 3.0.2 to do a screen capture into PICT
format. If I want the output in GIF or PS I use GraphicConverter 2.5
to convert it.
David
*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
|
|
|
Re: CAPTURING [message #7331 is a reply to message #6351] |
Thu, 31 October 1996 00:00  |
James Tappin
Messages: 54 Registered: December 1995
|
Member |
|
|
Mario Noyon wrote:
>
> Is there a way to capture a whole widget application in an image (in any
> format gif or ps)?
> I would like to capture a window with all its elements (buttons, menus,
> drawing widgets and the plots they contain).
>
> Anyone could help me ?
>
> Thanks in advance.
> --
> NOYON Mario
> Computer Science in Medical imaging
> University of Bordeaux 2
> mnoyon@jmc-luni.u-bordeaux2.fr
The only way I know of is to start up a second terminal and use some screen
capture tool (e.g. xwpick).
The main problem with trying to automate this seems to be that there doesn't
seem to be a way of converting the IDL widget identifier to the one the X-server
is using (a useful addition to WIDGET_INFO for a future release????) as then
xwpick could be spawned with the ID as an argument and thus save the manual
operations.
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
|
|
|