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

Home » Public Forums » archive » Widget_Draw - Help
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
Widget_Draw - Help [message #27339] Thu, 18 October 2001 12:55 Go to next message
Logan Lindquist is currently offline  Logan Lindquist
Messages: 50
Registered: October 2001
Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I figured I would start with something
easy,&nbsp;trying to create widget that displays images
in&nbsp;Widget_Draw.&nbsp; I am trying to pass the wdraw variable in&nbsp;a
Struct to the button procedure event handler. The&nbsp;event handler then calls
a procedure that will hopefully open the file, resize the image and display in
the wdraw window. Right now I am getting an error saying that my wdraw variable
is undefined. Some hints to what I am doing wrong, would be greatly appreciated!
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Widget_Draw creation</FONT></DIV>
<DIV><FONT face=Arial size=2>*****</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;wdraw = Widget_Draw(wbase_col, XSize=256,
YSize=256,$<BR>&nbsp; &nbsp;&nbsp;Graphics_Level=2, Expose_Events=1, Retain=0,
$<BR>&nbsp;&nbsp;&nbsp;Event_Func ='image_expose')</FONT></DIV>
<DIV><FONT face=Arial size=2>****</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Creating&nbsp;the Struct </FONT></DIV>
<DIV><FONT face=Arial size=2>****</FONT></DIV>
<DIV><FONT face=Arial size=2>info = { &nbsp;wdraw:wdraw,$<BR>&nbsp;&nbsp;&nbsp;
&nbsp;wid:wid }</FONT></DIV>
<DIV><FONT face=Arial size=2>Widget_Control, wbase, Set_UValue=info,
/No_Copy<BR>*****</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The button event handler code</FONT></DIV>
<DIV><FONT face=Arial size=2>*****</FONT></DIV>
<DIV><FONT face=Arial size=2>Widget_Control, event.top, Get_UValue=info,
/No_Copy<BR>&nbsp;&nbsp;selectFile, info.wdraw<BR>&nbsp;Widget_Control,
info.wdraw, Set_UValue=info, /No_Copy<BR>*****</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The file select procedure relating to the finding
the Draw Widget</FONT></DIV>
<DIV><FONT face=Arial size=2>*****</FONT></DIV>
<DIV><FONT face=Arial size=2>Widget_Control, wdraw, Get_Value=wid,
/No_Copy<BR>oldWin = !D.WINDOW<BR>WSET, wid<BR>&nbsp;loadct, 0,
/SILENT<BR>erase,wid<BR>*****</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Logan Lindquist</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="mailto:llindquist@mrdoc.cc">llindquist@mrdoc.cc</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>
Re: Widget_Draw - Help [message #27435 is a reply to message #27339] Tue, 23 October 2001 14:26 Go to previous messageGo to next message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
In the event handler, get the value of the draw widget and set that to
be the active window:

widget_control, Draw_ID, get_value=w_ID
wset, w_ID

You can also make the event handler return the focus to the originally
active direct graphics window.
Check out http://spot.colorado.edu/~romashki/idl/smart_w.pro to see how
the window focusing can be accomplished.

> Logan Lindquist wrote:
>
> How do I get the image to stay in the Widget_Draw when I click on
> another window? I was thinking that by coding in the PRO that the
> Widget_Draw calls [in the initialization], something updates the
> image. Is this the correct way to do that?
>
> Thanks,
>
> Logan
Re: Widget_Draw - Help [message #27437 is a reply to message #27339] Tue, 23 October 2001 13:40 Go to previous messageGo to next message
Logan Lindquist is currently offline  Logan Lindquist
Messages: 50
Registered: October 2001
Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>How do I get the image to stay in the Widget_Draw
when I click on another window? I was thinking that by&nbsp;coding in the PRO
that the Widget_Draw calls [in the initialization], something&nbsp;updates the
image. Is this the correct way to do that?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Logan</FONT></DIV></BODY></HTML>
Re: Widget_Draw - Help [message #27496 is a reply to message #27435] Wed, 24 October 2001 12:42 Go to previous message
Logan Lindquist is currently offline  Logan Lindquist
Messages: 50
Registered: October 2001
Member
Thanks Pavel !
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: A few IDL benchmarck results - question
Next Topic: How to get mouse values in ION

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

Current Time: Wed Oct 08 17:29:23 PDT 2025

Total time taken to generate the page: 0.00684 seconds