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

Home » Public Forums » archive » 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
convert_coord & overplotting across multiple widget draw windows [message #82669] Wed, 09 January 2013 17:20 Go to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
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
Previous Topic: Re: convert_coord & overplotting across multiple widget draw windows
Next Topic: Is there function about how to compute joint probability distribution?

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

Current Time: Fri Oct 10 02:36:35 PDT 2025

Total time taken to generate the page: 1.43901 seconds