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

Home » Public Forums » archive » Re: convert_coord & overplotting across multiple widget draw windows
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: convert_coord & overplotting across multiple widget draw windows [message #82667 is a reply to message #82666] Wed, 09 January 2013 17:33 Go to previous messageGo to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
I should also add that on subsequent clicks, the new item is still plotted in the 2nd window even though the over-plotting is breaking in the first window.

On Wednesday, January 9, 2013 8:20:08 PM UTC-5, Brian Cherinka wrote:
> I have 2 widget draw windows and I want to click and highlight in one and plot something in the other. I've managed to get the mouse coords to convert properly upon switching back and forth between windows, but when I overplot lines for highlighting, the lines, after the first call, either become shifted or do not plot at all. So something is still not quite right with the window coord system.
>
>
>
> I've set the 1 window to be the active one and I load in that window's !x, and !y so I'm not sure what else I need to do to get it to consistently overplot.
>
>
>
> My code is something like
>
>
>
> (*pState).wDrawFlux:begin
>
> widget_control, (*pState).wDrawFlux, get_value=value, get_uvalue=uvalue
>
> case event.type of
>
> ;button press
>
> 0:begin
>
> ;left mouse button press
>
> if event.press eq 1 then begin
>
> print, 'left mouse button pressed!'
>
> wset, value
>
> !x=(*pState).fluxd.x
>
> !y=(*pState).fluxd.y
>
> dataxy = convert_coord(event.x, event.y, /device, /to_data)
>
> fiberid = floor(dataxy[1])
>
> print, 'Fiber id: '+strtrim(fiberid,2)
>
>
>
> ;highlight
>
> oplot, [-5000,5000], fltarr(2)+fiberid, color=!red
>
> oplot, [-5000,5000], fltarr(2)+fiberid+1, color=!red
>
>
>
> ;plot in other window
>
> widget_control, (*pState).wDrawSpec, get_value=specwin
>
> wset, specwin
>
> plot, flat[*,fiberid]
>
>
>
> dot dot dot
>
>
>
> Thanks for any help.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL command line access from inside a widget?
Next Topic: convert_coord & overplotting across multiple widget draw windows

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

Current Time: Sun Oct 12 07:27:31 PDT 2025

Total time taken to generate the page: 0.96206 seconds