Code: Select all
EnableExplicit
#Win = 1
#Cvs = 1
#Txt = 2
If OpenWindow(#Win, 0, 0, 640, 480, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
CanvasGadget(#Cvs, 16, 16, 128, 24, #PB_Canvas_Container)
SetGadgetAttribute(#Cvs, #PB_Canvas_Cursor, #PB_Cursor_IBeam)
StringGadget(#Txt, 2, 2, 124, 20, "Test", #PB_String_BorderLess)
if StartVectorDrawing(CanvasVectorOutput(#Cvs))
MovePathCursor(0, GadgetHeight(#Cvs))
AddPathLine(GadgetWidth(#Cvs), 0, #PB_Path_Relative)
VectorSourceColor(RGBA(0, 255, 0, 192))
StrokePath(1)
StopVectorDrawing()
endif
CloseGadgetList()
ResizeGadget(#Cvs, 32, 32, #PB_Ignore, #PB_Ignore)
repeat
define Event = WaitWindowEvent()
select Event
case #PB_Event_CloseWindow
break
default
endSelect
forEver
endIf