X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Mar 2015 09:39 AM by  anon
Locking graphics in Gui
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:25
New Member


--
05 Mar 2015 09:39 AM
    Hello, I created a fancy GUI for a project and showed my 10 year old son it. He is interesting in programming and I wanted show off the sorts of things you can make. Anyway, within about three seconds he can screwed up all the graphics with in the Gui. My question is, is there a way to lock graphics in a GUi? I am using window_widgets with either a map() graphic or image () graphics. I still need the user to be able to click on the map so I can get points from the user clicks, but I don't want the user to be able to zoom, rotate or translate the graphic.

    Deleted User



    New Member


    Posts:
    New Member


    --
    09 Mar 2015 01:55 PM
    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
    You are not authorized to post a reply.