' createwindow.bmx
Import MaxGui.Drivers
Strict
Local window1:TGadget,window2:tgadget
Local button1:tgadget,button2:tgadget
window1=CreateWindow("My Window #1",40,40,320,240)
window2=CreateWindow("My Window #2",140,140,320,240)
button1=CreateButton("Click me",10,10,80,20,window1)
button2=CreateButton("Hide me",10,10,80,40,window2)
HideGadget window2
While True
WaitEvent
Select EventID()
Case EVENT_GADGETACTION
If EventSource()=Button1
ShowGadget window2
DisableGadget window1
End If
If EventSource()=Button2
EnableGadget window1
HideGadget window2
End If
Case EVENT_WINDOWCLOSE
If EventSource()=window2
HideGadget window2
EnableGadget window1
End If
If EventSource()=Window1
Notify "Stop all!"
End
End If
End Select
Wend
You need to intercept what window/button the user clicks.
|