Here is an example of what I need but only more correct.
Can anyone help me? Thank you in advance.
And it is very desirable cross-platform.
Code: Select all
; Module
#PB_EventType_Show = #PB_EventType_FirstCustomValue
Procedure CallBack()
Select EventType()
Case #PB_EventType_Show
Debug "show"
EndSelect
EndProcedure
Procedure TimerCallBack()
If IsWindowVisible_(GadgetID(0))
RemoveWindowTimer(0, EventTimer())
PostEvent(#PB_Event_Gadget, 0,0, #PB_EventType_Show)
EndIf
EndProcedure
Procedure Gadget(Window, Gadget, X.l, Y.l, Width.l, Height.l)
AddWindowTimer(Window, 1, 10)
CanvasGadget(Gadget, X, Y, Width, Height)
BindGadgetEvent(Gadget, @CallBack())
BindEvent(#PB_Event_Timer, @TimerCallBack(), Window)
EndProcedure
; EndModule
If OpenWindow(0, 0, 0, 220, 220, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Gadget(0, 0, 10, 10, 200, 200)
; HideGadget(0,1)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf