Multiple Windows

BlitzMax Forums/MaxGUI Module/Multiple Windows

Jayjay(Posted 2009) [#1]
Thanks in advance everyone!

I have a main 'Window' open. When the user selects a menu option from the main window, I want another window to open. This OTHER window will take input from the user and close when done where focus will return back to the MAIN window...how can I achieve this...its driving me insaner than I already am!


degac(Posted 2009) [#2]
' createwindow.bmx

Import MaxGui.Drivers

Strict 

Local window1:TGadget,window2:tgadget
Local button1:tgadget,button2:tgadget

window1=CreateWindow("My Window #1",40,40,320,240)

window2=CreateWindow("My Window #2",140,140,320,240)

button1=CreateButton("Click me",10,10,80,20,window1)
button2=CreateButton("Hide me",10,10,80,40,window2)
HideGadget window2



While True
	WaitEvent 
	Select EventID()
	
		Case EVENT_GADGETACTION
		
			If EventSource()=Button1
					ShowGadget window2
					DisableGadget window1
			End If
			
			If EventSource()=Button2
					EnableGadget window1
					HideGadget window2
			End If
		
		Case EVENT_WINDOWCLOSE
		
			If EventSource()=window2
				HideGadget window2
				EnableGadget window1
			End If							
			
			If EventSource()=Window1
				Notify "Stop all!"
				End
			End If
			
	End Select
Wend


You need to intercept what window/button the user clicks.


Brucey(Posted 2009) [#3]
MaxGUI doesn't support "true" modal windows, so you may have problems.


SebHoll(Posted 2009) [#4]
See this thread:

Dialog Windows