[SOLVED]any way to resize window class height and width dynamically...?

when we make windows we set the height and width for it at the initialization method.

but how if we want to change existing window height after it already created?

up until now i dispose old window and recreate new window using new height (mostly need to store old window settings first and pass on to new window)... but if there's a cleaner way without disposing old window it would be nicer.
I haven't tried these, but looking at the definition of the Window class in the help file, you could try either of the following:


@window.move(x, y, width, height)


or


@window.width =


@window.height =


probably both of those options would be followed by a refresh, which disposes of the contents and recreates them.
I usually use this method

class Window_Base < Window alias aliased_width= width= def width=(w) self.aliased_width = w create_contents end alias aliased_height= height= def height=(h) self.aliased_height = h create_contents endendUsage :

@window.width = [email hidden] = new_numberNote : That is just an example. You may improve by in your own way
@shaz: before i tried

@window.height = [email hidden] = [email hidden] it don't update the new height.

then i read theodoric code and add one line and it works:

@window.height = [email hidden] = [email hidden][email hidden] we need to run create_contents method after changing window height or width.

it dispose the 'old' contents and recreate it with new height / width. while refresh only 'clear' the content 😀 .

btw... thank you both for your time 😀 .

@theo: thanks ya gan 😀 .

i guess the problem solved
Sama-sama. Hitung2 balas jasa yang kemaren 😀
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-any-way-to-resize-window-class-height-and-width-dynamically.19700/