
CanvasGadget() is still new for me, and would like to use it.
I do not know what to put at the SetGadgetState() so the canvas gadget is updated with the new text.
For images, I know that I need to use ImageID() as second parameter, but there is no CanvasID(), so I am puzzled.
Here an example: (the text of the clock should be cleared, that's where is my problem)
Code: Select all
OpenWindow(0,0,0,300,200,"Clock",#PB_Window_ScreenCentered)
F1=LoadFont(#PB_Any,"Tahoma",8,#PB_Font_Bold)
Can2=CanvasGadget(#PB_Any,0,0,180,30)
StartDrawing(CanvasOutput(Can2))
FillArea(0,0,-1,$46596E)
StopDrawing()
c=0
Repeat
Text.s=FormatDate("%hh : %ii : %ss",Date())
StartDrawing(CanvasOutput(Can2))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(F1)
DrawText(12+1,8+1,Text.s,$000000); shadows always black
DrawText(12,8,Text,$FFFFFF)
StopDrawing()
SetGadgetState(Can2,0); how to update this? <<<<<<<<<<<<<<
Delay(50)
C+1
Until C>=60; about 3 seconds