DisableGadget() is usefull, i think DisableWindow() would be nice to.
I think there's the equivalent function on linux and mac os, isn't it ?
Code: Select all
;-
;- Enable/Disable a window, just like the DisableGadget() function does...
;-
Procedure.l DisableWindow(Window.l,State.b)
If IsWindow(Window)
EnableWindow_(WindowID(Window),#True-State)
EndIf
EndProcedure
Enumeration
#WndParent
#WndChild
EndEnumeration
If OpenWindow(#WndParent,0,0,680,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Parent Window")
If OpenWindow(#WndChild,0,0,400,300,#PB_Window_WindowCentered|#PB_Window_SystemMenu,"Child Window",WindowID(#WndParent))
DisableWindow(#WndParent,#True)
Repeat
If WaitWindowEvent() = #PB_Event_CloseWindow
CloseWindow(#WndChild) : Break
EndIf
ForEver
DisableWindow(#WndParent,#False)
EndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Best regards.