Posted: Wed Apr 03, 2002 12:33 am
Restored from previous forum. Originally posted by merendo.
Procedure window()
OpenWindow(1,20,20,158,100,0,"Another Test")
CreateGadgetList(WindowID())
ButtonGadget(1,8,8,136,25,"Do something")
GadgetToolTip(1,"Does something")
ButtonGadget(2,8,41,136,25,"Close")
GadgetToolTip(2,"Closes this window")
Repeat
event = WaitWindowEvent()
If event = #PB_EventGadget
Select EventGadgetID()
Case 1
MessageRequester("Something","Something for nothing",0)
Case 2
CloseWindow(1)
EndSelect
EndIf
ForEver
ProcedureReturn 0
EndProcedure
InitGadget(2)
OpenWindow(0,10,10,400,300,#PB_Window_SystemMenu | #PB_Window_MinimizeGadget,"Test")
CreateGadgetList(WindowID())
ButtonGadget(0,8,8,200,25,"Click here to open a window")
GadgetToolTip(0,"Opens a second window")
Repeat
event = WaitWindowEvent()
If event = #PB_EventGadget
Select EventGadgetID()
Case 0
window()
EndSelect
EndIf
Until event = #PB_EventCloseWindow
If I try this code it seems to work fine, but if I click "Click here to open a window" the window opens. Then, if I close the second window, all the gadgets of the first window don´t work. Is this normal or a bug??? Thank you, merendo
We always need to hear both sides of the story (by Phil Collins)
Procedure window()
OpenWindow(1,20,20,158,100,0,"Another Test")
CreateGadgetList(WindowID())
ButtonGadget(1,8,8,136,25,"Do something")
GadgetToolTip(1,"Does something")
ButtonGadget(2,8,41,136,25,"Close")
GadgetToolTip(2,"Closes this window")
Repeat
event = WaitWindowEvent()
If event = #PB_EventGadget
Select EventGadgetID()
Case 1
MessageRequester("Something","Something for nothing",0)
Case 2
CloseWindow(1)
EndSelect
EndIf
ForEver
ProcedureReturn 0
EndProcedure
InitGadget(2)
OpenWindow(0,10,10,400,300,#PB_Window_SystemMenu | #PB_Window_MinimizeGadget,"Test")
CreateGadgetList(WindowID())
ButtonGadget(0,8,8,200,25,"Click here to open a window")
GadgetToolTip(0,"Opens a second window")
Repeat
event = WaitWindowEvent()
If event = #PB_EventGadget
Select EventGadgetID()
Case 0
window()
EndSelect
EndIf
Until event = #PB_EventCloseWindow
If I try this code it seems to work fine, but if I click "Click here to open a window" the window opens. Then, if I close the second window, all the gadgets of the first window don´t work. Is this normal or a bug??? Thank you, merendo
We always need to hear both sides of the story (by Phil Collins)