PVGadgets_Refresh (GadgetID.l)

Top  Previous  Next

Forces the Specified Gadget to be Redrawn.

 

Use:

PVGadgets_Refresh(#Gadget)

 

 

 

Example:

 

#Window_Main=0

#Gadget_Main_Ok=1

 

#Gadget_Main_Canvas=2

#Image_Main_Canvas=2

 

 

If OpenWindow(#Window_Main,175,0,184,172,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Demo")

If CreateGadgetList(WindowID(#Window_Main))

PVGadgets_Canvas(#Gadget_Main_Canvas,#Image_Main_Canvas,15,25,150,100,12632256)

ButtonGadget(#Gadget_Main_Ok,105,140,60,20,"Press Me")

 

UseImage(#Image_Main_Canvas)

StartDrawing(ImageOutput())

DrawingMode(4)

Box(10,10,130,80,$00FFFF)

Box(20,20,110,60,$00FFFF)

StopDrawing()

PVGadgets_Refresh(#Gadget_Main_Canvas)  ;<-- After drawing to the Canvas, Refresh it so we can see results

 

Repeat

EventID=WaitWindowEvent()

If EventID=#PB_Event_Gadget

If EventGadgetID()=#Gadget_Main_Ok

UseImage(#Image_Main_Canvas)

StartDrawing(ImageOutput())

Circle(50,50,50,$FF0000)

Box(60,60,70,30,$0000FF)

StopDrawing()

PVGadgets_Refresh(#Gadget_Main_Canvas)  ;<-- After drawing to the Canvas, Refresh it so we can see results

EndIf

EndIf

Until EventID=#PB_Event_CloseWindow

 

EndIf

EndIf