Programming Guide



sm_resize

Notifies Panther of a change in the display size

int sm_resize(int rows, int columns);

rows, columns
Specifies the new display size, where the maximum value of rows and columns is 255. If the specified rectangle is larger than the physical display, results can be unpredictable.

Returns

Description

sm_resize lets you change the default display set by the video file's LINES and COLMS entries. Character-mode applications can run in different-sized windows by setting their individual display sizes at runtime. Also use sm_resize to switch between normal and compressed modes—for example, 80 and 132 columns on VT100-compatible terminals.

Example

#include <smdefs.h>
#include <smkeys.h>
#include <smglobs.h>
#define WIDTH_TOGGLE PF9

/* Somewhat irregular code to switch a VT-100
* between 80- and 132-column mode by pressing PF9. */

switch (sm_input(IN_DATA))
{
...
case WIDTH_TOGGLE:
if (sm_inquire(I_MXCOLMS) == 80)
{
printf("\033[?3h");
sm_resize(sm_inquire(I_MXLINES), 132);
}
else
{
printf("\033[?3l");
sm_resize(sm_inquire(I_MXLINES), 80);
}
break;
...
}