Reference Guide > W Routines > WSet Procedure
  

WSet Procedure
Used to select the current, or “active” window to be used by the graphics and imaging routines.
Usage
WSet, window_index
Input Parameters
window_index — The window index of the new current window.
Keywords
Resize — If present and nonzero, notifies PV‑WAVE that a window being used to display PV‑WAVE graphics (e.g., with the WINDOW command’s Set_Xwin_Id or Set_Win_Id keyword) has been resized. PV‑WAVE updates the window size in the !D system variable so that subsequent PV‑WAVE graphics commands use the new window size.
Discussion
WSet can be used only on displays with window systems.
The window-index number of the current window is given by the read-only system variable !D.Window.
Window Resizing in Noninteractive Applications
On UNIX, if you are writing a PV‑WAVE noninteractive application, you must use the Resize keyword in order for PV‑WAVE to recognize when a user resizes a graphic window.
Example 1 — UNIX
This example shows how the keyword Resize is used in a PV‑WAVE Widgets application written in the C programming language. The cwavec function is used to call the PV‑WAVE functions from the C program.
static void resizeCB_drawingArea( widget, data, cbs )
        Widget          widget;
        XtPointer       data;
        XmDrawingAreaCallbackStruct     *cbs;
{
    int action, numcmds, istat, cwavec();
    char *cmds[2];
    if (!XtIsRealized(widget)) return;
    if (cbs->reason == XmCR_RESIZE) {
        action = 2;
        cmds[0] = 'erase';
        istat = cwavec (action, 1, cmds);
        /*
         * Update display, to solve Motif geometry changes
         * and give PV-WAVE the proper window size.
         */
        XmUpdateDisplay(widget);
        cmds[0] = 'WSet,0,/Resize';
        cmds[1] = 'SHADE_SURF, HANNING(20,20)';
istat = cwavec (action, 2, cmds);
    }
}
Example 2 — UNIX
This example shows how the keyword Resize is used in a PV‑WAVE Widgets application written in the C programming language. The wavecmds function is used to call the PV‑WAVE functions from the C program.
static void resizeCB_drawingArea( widget, data, cbs )
        Widget          widget;
        XtPointer       data;
        XmDrawingAreaCallbackStruct     *cbs;
{
    if (!XtIsRealized(widget)) return;
    if (cbs->reason == XmCR_RESIZE) {
        wavecmd('ERASE');
        /*
         * Update display, to solve Motif geometry changes
         * and give PV-WAVE the proper window size.
         */
        XmUpdateDisplay(widget);
        wavecmd('WSet,0,/Resize');
        wavecmd('SHADE_SURF, HANNING(20,20)');
    }
}
See Also
WDELETE,   WINDOW,   WSHOW
System Variables:  !D.Window

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.