resizing windows

BlitzMax Forums/MaxGUI Module/resizing windows

D2006(Posted 2006) [#1]
Hello,

is there a possibility to force a constant aspect ratio of a window while the user is resizing it?

I want my little windowed game to be scalable just by resizing it. that works fine after I read about the possible errors many before me did with resizing a canvas :) But now I have the problem that the user - once he resized the window - might not find the right aspect ratio again. And distorted graphics aren't very good looking ;)

thanks for any help

regards,
D2006


CASO(Posted 2006) [#2]
Here is a simple concept:
window=CreateWindow("window",0,0,400,300)
Repeat
	Select WaitEvent()
		Case EVENT_WINDOWSIZE
			x=GadgetX(window)
			y=GadgetY(window)
			w=GadgetWidth(window)
			SetGadgetShape(window,x,y,w,w*0.75)
		Case EVENT_WINDOWCLOSE
			End
	End Select
Forever

I hope this helps.