Programming Guide |
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
andcolumns
is 255. If the specified rectangle is larger than the physical display, results can be unpredictable.
sm_resize
lets you change the default display set by the video file'sLINES
andCOLMS
entries. Character-mode applications can run in different-sized windows by setting their individual display sizes at runtime. Also usesm_resize
to switch between normal and compressed modes—for example, 80 and 132 columns on VT100-compatible terminals.
#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;
...
}