Hi, In checking with events with waitevent, use $205 and $206 events to see if you are "in" or "out" any given canvas. Use EventSource to find which canvas you are entering or leaving. Here, you can simply set global flags to specify if the mouse is "in" or "out" any given canvas where as you can make sure when you hit the mousebutton that your 'pic color' function will only get called when supposed to.
below is sort of pseudo code on checking if the mouse has entered or exited any canvas:
Hope this helps...
below is sort of pseudo code on checking if the mouse has entered or exited any canvas:
;$205 - Mouse enter ;Generated when the mouse pointer enters a canvas gadget. Case $205 Select EventSource() Case MainCanvas DebugLog "enter MainCanvas" Case ColorPickerCanvas DebugLog "enter ColorPickerCanvas" End Select ;$206 - Mouse leave ;Generated when the mouse pointer leaves a canvas gadget. Case $206 Select EventSource() Case MainCanvas DebugLog "exit MainCanvas" Case ColorPickerCanvas DebugLog "exit ColorPickerCanvas" End Select
Hope this helps...