I can't use a screen because it has a GUI#NULL wrote:It sounded to me as if you would draw and then clear, both in a single drawing block, that's why I asked. But just clear and draw makes sense though. Any reason why you don't use a screen?

I can't use a screen because it has a GUI#NULL wrote:It sounded to me as if you would draw and then clear, both in a single drawing block, that's why I asked. But just clear and draw makes sense though. Any reason why you don't use a screen?
I think there's a problem in Pb. Try the following code with and without the MessageRequester lineJosh wrote:This is already implemented and is called SetGadgetColor()marcoagpinto wrote:@Fred:
Could you implement a function in PB to clear a canvas?
ClearCanvasGadget(gadget, colour)![]()
Look at my posting from 17.01.2019 20:47 in this thread.
Code: Select all
OpenWindow (0, 0, 0, 600, 600, "Test")
CanvasGadget (0, 0, 0, 500, 500)
;MessageRequester ("", "")
StartDrawing (CanvasOutput(0))
DrawText (10, 10, "TEST", #Yellow, #Blue)
StopDrawing ()
SetGadgetColor (0, #PB_Gadget_BackColor, #Yellow)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Can you explain what you get? I don't see anything unusual, but I'm on Linux.Josh wrote:I think there's a problem in Pb. Try the following code with and without the MessageRequester line
Code: Select all
OpenWindow (0, 0, 0, 600, 600, "Test")
CanvasGadget (0, 0, 0, 500, 500)
MessageRequester ("", "")
StartDrawing (CanvasOutput(0))
DrawText (10, 10, "TEST", #Yellow, #Blue)
StopDrawing ()
HideGadget(0,1)
SetGadgetColor (0, #PB_Gadget_BackColor, #Yellow)
HideGadget(0,0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow