Subwindow (MaxGUI)

BlitzMax Forums/BlitzMax Beginners Area/Subwindow (MaxGUI)

wedoe(Posted 2006) [#1]
Hmm, I can't seem to figure how to go about this one.
I want to make an "About" window for my app but when
I close the about window the original window closes too !!

I'd like it to work like NOTIFY, graying out the original
window as long as the about-window is open and then jump
right back to the original window and continue like nothing
at all happened when the sub-window is closed...


Dreamora(Posted 2006) [#2]
If the about is shown, disable your main window. if the about is closed, just freegadget the about window and enable the main window again.
I would assume that your event handling so far only looks for event_windowclose but not for the sender and thus closes the main window instead of the about window.


wedoe(Posted 2006) [#3]
It looks for event_closewindow, yes, but both
windows close on ABOUT exit ??


assari(Posted 2006) [#4]
You'll need to check for event source like so
SuperStrict

Local MyWindow:TGadget=CreateWindow("Main Window", 200,200,320,240)
Local AboutWindow:TGadget=CreateWindow("About Window",250,250,200,100,MyWindow)


Repeat
  WaitEvent()
  Select EventID()
  Case EVENT_WINDOWCLOSE
	Select EventSource()
	Case AboutWindow
		FreeGadget AboutWindow
	Case Mywindow
		End
	End Select
   End Select
Forever



wedoe(Posted 2006) [#5]
AHA !, thanks assari ;o)

BTW: Your MaxGUI tuts are great :oD