Resizing Simple Graphical Window

So i’m using Emily Short’s Simple Graphical Window extension in my project, and I was wondering if there’s a way to change the dimensions of the Window during the actions of a command?

I know you can set it’s size in initial project setup:

The measurement of the graphics window is 30.

But it would be great if there was a way to change that at a later time.

Now the measurement of the graphics window is 60;

Doesn’t do anything, even though it compiles.

Failing being able to resize it, is there a way to have a second window set to the secondary size that can then be opened and closed accordingly?

Simple Graphical Window itself doesn’t provide any way to resize windows. The underlying windowing layer, called Glk, does provide such functionality, but to access it you’ll need to dig into how Glk actually works (which is defined in considerable detail in the Glk specification). What you would need is something like

To resize the graphics window to (size - a number): 
	(- glk_window_set_arrangement(glk_window_get_root(), winmethod_Above + winmethod_Proportional, {size}, 0); -)

This is completely untested and probably needs adjusting to get it to work, but contains the basic idea.

Alternatively you can just close and reopen the window. For text windows you’d lose all the previous text if you did that, but for a graphic window you’re going to refresh it anyway so it’s not a problem.

I swear I had already tried that! lol

That was the solution I was looking for though, so thanks Dannii!

I think the key thing I was missing (or did wrong initially) was to resize the window before closing and then reopening it.
Not sure…but changing the size in between closing and opening definately does the trick!

Anyway, it’s working now! :+1: