Window size by application

BlitzMax Forums/BlitzMax GUI Programming/Window size by application

Is it possible to resize a window by the application?

' createwindow.bmx

Import MaxGui.Drivers

Strict 

Local window:TGadget
Local full:tgadget
Local minimize:tgadget,special:tgadget

window=CreateWindow("My Window",40,40,320,240)
full = CreateButton("FULL" , 10 , 10 , 80 , 20 , window) 
minimize = CreateButton("MINIMIZE" , 10 , 30 , 80 , 20 , window)
special  = CreateButton("SPECIAL" , 10 , 50 , 80 , 20 , window)




While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID() 
		
		Case EVENT_GADGETACTION
			
			
			Select EventSource() 
			
				Case special
					Print window.xpos
					Print window.ypos
					
					window.width = 200
					window.height = 400
					window.Rethink()
			
				Case full
					MaximizeWindow window
			
				Case minimize
					MinimizeWindow window
			
			End Select

		Case EVENT_WINDOWCLOSE
					End
	End Select
Wend


Thanx, this is the solution for my application!

It's not recommended to use the internal MaxGUI methods as the effect of these methods may change without notice. Therefore Instead of using the Rethink() method, I suggest you use SetGadgetShape() (see docs).