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?
Clearing a CanvasGadget
- marcoagpinto
- Addict

- Posts: 1076
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Clearing a CanvasGadget
Re: Clearing a CanvasGadget
You can use a windowed screen in combination with other gui controls. The Doc for OpenWindowedScreen() even has examples for this.
Re: Clearing a CanvasGadget
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
sorry for my bad english
Re: Clearing a CanvasGadget
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
Re: Clearing a CanvasGadget
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
Egypt my love
