Procedure IsMouseOverGadget(Gadget)
target1=Gadget
GetWindowRect_(GadgetID(Gadget),GadgetRect.RECT)
GetCursorPos_(mouse.POINT)
If mouse\x>=GadgetRect\Left And mouse\x<=GadgetRect\right And mouse\y>=GadgetRect\Top And mouse\y<=GadgetRect\bottom
ProcedureReturn #True and target1
Else
ProcedureReturn #False
EndIf
EndProcedure
;inside loop
EventID = WaitWindowEvent()
Select EventID
Case #WM_rButtonDown
target=IsMouseOverGadget(#Image_9)
If target=#True
DisplayPopupMenu(1,WindowID())
EndIf
;how i paste
Procedure pasteimage()
If CreateImage(17, 270,210)
foo.l = GetClipboardData(#PB_Clipboard_Image)
If foo
If StartDrawing(ImageOutput())
DrawImage(foo,0,0,270,210)
StopDrawing()
EndIf
EndIf
EndIf
SetGadgetState(target1,UseImage(17))
EndProcedure
Case #MENU_9
pasteimage()
Code: Select all
Code: Select all
Code: Select all

