Posted: Tue Sep 24, 2002 8:57 am
Restored from previous forum. Originally posted by WolfgangS.
Hi !
I discovered a few strange effects in correlation with 2 Windows.
If i open my 'Motherwindow'and open a 2nd Window (for preferences) in
a procedure, i can close it, but after this, i can't do anything
anymore with the MotherWindow.
If i use UseWindow() nothing happends !!???!?!
Probably there is some stuff to do but i don't know what .... Any
help ?
MFG
:)WolfgangS
Hi !
I discovered a few strange effects in correlation with 2 Windows.
If i open my 'Motherwindow'and open a 2nd Window (for preferences) in
a procedure, i can close it, but after this, i can't do anything
anymore with the MotherWindow.
If i use UseWindow() nothing happends !!???!?!
Probably there is some stuff to do but i don't know what .... Any
help ?
MFG
:)WolfgangS
Code: Select all
#ID_MWindow =0 ; Mother
#ID_SWindow =1 ; Second
#ID_Button1 =10
#ID_Button2 =11
Procedure openwindow2()
hnd_SWindow=OpenWindow(#ID_SWindow,200,200,200,200,0,"Second Window")
If CreateGadgetList(hnd_SWindow)
ButtonGadget(#ID_Button2,50,50,50,20,"Exit")
EndIf
Repeat
Event=WaitWindowEvent()
If Event=#PB_EventGadget
If EventGadgetID()=#ID_Button2
CloseWindow(#ID_SWindow)
EndIf
EndIf
Until ForEver
EndProcedure
hnd_MWindow=OpenWindow(#ID_MWindow,100,200,200,200,#PB_Window_SystemMenu,"Test")
If CreateGadgetList(hnd_MWindow)
ButtonGadget(#ID_Button1,50,50,50,20,"Open")
EndIf
Repeat
Event=WaitWindowEvent()
If Event=#PB_EventGadget
If EventGadgetID()=#ID_Button1
openwindow2()
EndIf
EndIf
Until Event=#PB_Event_CloseWindow