/* ************* Copyright 1990 by Vermont Creative Software ************** TOPIC: Program that illustrates changing number of columns on the fly. BY: Mark Schweitzer DATE: 12/18/90 DESCRIPTION: Example of how to dynamically change the number of columns between 80 and 132 from within a Vermont Views application. In order for this to work properly, the "co" mnemonic in VVTERMCAP must initially be set to the widest column size. In this case, co#132. This is necessary so that internal buffers are sufficiently allocated to handle the largest mode. This application was written for a VT100 terminal. */ #include #include #define SET_132_COL "\033[?3h" #define SET_80_COL "\033[?3l" main() { WINDOW wn; init_vv(); wn_sdef(0, 0, 24, 132, LNORMAL, BDR_SLNP, &wn); wn_set(&wn); v_st("Terminal is in 132 column mode.\n", &wn); v_st("Press any key to continue.", &wn); ki(); wn_unset(&wn); printf(SET_80_COL); _vid_scr.col_q = 80; _vpbytes = 80 * 24 * 2; wn_sdef(0, 0, 24, 80, LNORMAL, BDR_SLNP, &wn); wn_set(&wn); v_st("Terminal is in 80 column mode.\n", &wn); v_st("Press any key to continue.", &wn); ki(); wn_unset(&wn); printf(SET_132_COL); _vid_scr.col_q = 132; _vpbytes = 132 * 24 * 2; wn_sdef(0, 0, 24, 132, LNORMAL, BDR_SLNP, &wn); wn_set(&wn); v_st("Terminal is in 132 column mode.\n", &wn); v_st("Press any key to continue.", &wn); ki(); wn_unset(&wn); printf(SET_80_COL); exit_vv(); return(1); }