Select...Case question with Window Gadgets.
Posted: Mon Jul 18, 2005 1:52 pm
I have used PureVisionXP to export the code to a set of windows for my progam with an eventloop for the main window. This (and the examples provided) use the Select...Case set of commands which I am strugling with a little.
I have an "About" window which pops up okay from within the main loop. This then transfers to a seperate procedure to run a small loop so you have to it the close window gadget in the top right or a standard button on the middle of the window. The button gadget works fine, but I cannot get the close gadget on the window to work.
I assume it is something simple that I have done or missed. I looked at the code exported (which lets the main window close and program to exit) but this doesn't appear to work
Can someone take a look at the code (shown below) and tell me what I have missed please. It is annoying as the button gadget works perfectly....
Thanks
Max
The code used to call the window is this:
The "WIndow_AboutWIndow" was defined by PureVisionXP when it exported the window Code. "AboutWindow" is the procedure above.
I have an "About" window which pops up okay from within the main loop. This then transfers to a seperate procedure to run a small loop so you have to it the close window gadget in the top right or a standard button on the middle of the window. The button gadget works fine, but I cannot get the close gadget on the window to work.
I assume it is something simple that I have done or missed. I looked at the code exported (which lets the main window close and program to exit) but this doesn't appear to work

Can someone take a look at the code (shown below) and tell me what I have missed please. It is annoying as the button gadget works perfectly....
Thanks
Max
Code: Select all
Procedure AboutWindow(x)
aboutquit=0
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadgetID()
Case #Gadget_AboutWindow_AboutClose
aboutquit=1
EndSelect
EventID=WaitWindowEvent()
Select EventID
Case #PB_Event_CloseWindow
If EventWindowID()=#Window_AboutWindow
aboutquit=1
EndIf
EndSelect
EndSelect
Until aboutquit=1
CloseWindow(#Window_AboutWindow)
EndProcedure
The "WIndow_AboutWIndow" was defined by PureVisionXP when it exported the window Code. "AboutWindow" is the procedure above.
Code: Select all
Case #MenuBar_MainWindow_About
Window_AboutWindow()
AboutWindow(1)