In the compiler settings with DPI enabled.
Code: Select all
Procedure Canvas(gadget)
Protected color = RGB( Random(255), Random(255), Random(255) )
CanvasGadget(gadget, 0, 0, 200, 200)
StartDrawing(CanvasOutput(gadget))
DrawingMode(#PB_2DDrawing_Default)
Box(0,0,OutputWidth(), OutputHeight(), color)
DrawText(10,10, Str(gadget))
StopDrawing()
EndProcedure
OpenWindow(1, 110, 110, 200, 200, "", #PB_Window_BorderLess)
Canvas(1)
Repeat
event = WaitWindowEvent()
If event = #PB_Event_Gadget
If EventType() = #PB_EventType_LeftButtonDown
mouse_x = DesktopMouseX()
ResizeWindow(EventWindow(), mouse_x, #PB_Ignore, #PB_Ignore, #PB_Ignore)
Debug "mouse_x = "+mouse_x +" gadget_x = "+ GadgetX(EventGadget(), #PB_Gadget_ScreenCoordinate)
EndIf
EndIf
Until event = #PB_Event_CloseWindow

