Moving the Origin of a Window in a Memory File

The origin of the window in the memory file is stored in the window structure. The origin specifies where the window is located over the memory file. Figure 45.2 shows what part of the memory file the viewer would see with two different origins.

Figure 45.2: Origin of the Memory File in a Window

By default, when a memory file is assigned to a window with wn_mfdef() or sw_mf(), the origin is set to (0, 0). To change the location of the window in the memory file, call the set window origin function, sw_org():

void sw_org(row, col, wnp)
 
int row;
/* Memory file row
*/
int col;
/* Memory file column
*/
WINDOWPTR wnp;
/* Pointer to window 
*/

For example, to initially display the memory file so that row 5 is the top row of the file displayed, call:

sw_org(5, 0, wnp);


Home Contents Previous Next