Hello,
If you are using Widget_Window() you can specify the selection change handler and prevent things from being selected there. Example code below: Run nochange and you should see an image in a window. If you click in the window you should see the coordinates of the click in the console, but you should not be able to select, move or otherwise change the image.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
function nochange_selection, win, graphic, mode, wasSel
return, 0
end
function nochange_mouse, window, x, y, button, keymods, clicks
print, x, y
end
pro nochange
wBase = widget_base()
wWin = widget_window(wBase, SELECTION_CHANGE_HANDLER='nochange_selection', $
MOUSE_DOWN_HANDLER='nochange_mouse')
widget_control, wBase, /REALIZE
im = image(/test, /current)
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I hope this helps.
Cheers,
eddie
|