help window

BlitzPlus Forums/BlitzPlus Programming/help window

gellyware(Posted 2004) [#1]
How can I handle someone closing a help window? I cant seem to find a way to get around the following:

IF a help window is open, and the user clicks close (or the x) then the whole program ends.

The main application window should exit if someone hits the x, but not the help window. Does anyone have any samples showing how to handle two windows being open with the ability to close one without closing the other?

Thanks


EOF(Posted 2004) [#2]
Try this:
mainwin=CreateWindow("main",200,200,400,300,0,3)
helpwin=CreateWindow("help",150,80,100,80,0,3)
ActivateGadget mainwin

quit=False

Repeat
 ev=WaitEvent()
 Select ev
  Case $803
   If EventSource()=mainwin
    If helpwin<>0 FreeGadget helpwin
    FreeGadget mainwin
    quit=True
   EndIf
   If EventSource()=helpwin
    FreeGadget helpwin : helpwin=0
   EndIf
 End Select
Until quit=True

End



gellyware(Posted 2004) [#3]
Hey Syntax, Thanks as always!

/bonk myself