StartDrawing(GadgetOutput())
Posted: Sun Jan 14, 2007 6:34 pm
I would like this function:StartDrawing(GadgetOutput()) for use DrawAlphaImage on the gadget!
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Procedure.l GadgetOutput(window.l,gadget.l)
Protected wo=0
wo=WindowOutput(window)
PokeL(wo+4,GadgetID(gadget))
ProcedureReturn wo
EndProcedure
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 200, 20, "Standard Button")
ButtonGadget(1, 10, 40, 200, 20, "Left Button", #PB_Button_Left)
ButtonGadget(2, 10, 70, 200, 20, "Right Button", #PB_Button_Right)
ButtonGadget(3, 10,100, 200, 60, "Multiline Button (longer text gets automatically wrapped)", #PB_Button_MultiLine)
ButtonGadget(4, 10,170, 200, 20, "Toggle Button", #PB_Button_Toggle)
Repeat
StartDrawing(GadgetOutput(0,0))
Box(0,0, 10, 10, RGB(255, 0, 0))
StopDrawing()
StartDrawing(WindowOutput(0))
Box(0,0, 10, 10, RGB(0, 255, 0))
StopDrawing()
Delay(10)
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
..if you don't have a callback which redraws the window..Kaeru Gaman wrote:which gadget do you like to have it for?
perhaps there are alternative workarounds.
note that Drawing is no durable action. it will be erased with the next refresh-event.