Window library WindDelete() WindSetStr()
Programming guideline of WinDom

WindSet()

NAME

WindSet - set the window parameters.

PROTOTYPAGE

/* Prototype for 16 bits compilers */
void WindSet( WINDOW *win, int mode, ...);
/* Prototype for 32 bits compilers */
void WindSet( WINDOW *win, int mode, int ap1, int ap2, int ap3, int ap4);

PARAMETERS

win:
address of window descriptor,

mode:
see WINDSET MODE section,

...:
depend on mode value.

DESCRIPTION

This function is very important. It replaces completly the wind_set() function that should be never used.

There are two prototypes of this function : one addressing 16 bits compilers and one addressing 32 bits compilers. For the second case, we use the classic four integers parameters to prevent errors from passing pointer parameters. Indeed, with 32 bits mode, integer and pointer have same size. For that reason, pointer parameters must be encapsuled with ADR() macro function. The fixing prototype of WindSet() cause warning or error if this rule is not respected. You can use also WindSetStr() or WindSetPtr() macros function with modes attenting for one or two pointer parameters.

For 16 bits compilers (Pure C and Sozobon) there is no change except this rule should respected if you want to hack portable source.

WINDSET MODE

Each mode of WindSet() are listed in the next table. The difference with wind_set() are underlined.

WindSet() modes
Mode Description Comments
WF_NAME Set the window title. The wind_set() uses the
title is only used for same title for iconified
uniconified window. or non iconified window.
WindSet( win, WF_NAME, title);
WF_ICONTITLE Set the icon window title. Specific WinDom feature.
WindSet( win, WF_ICONTITLE,
         title);
WF_ICONDRAW Set the icon drawing function Specific WinDom feature.
WindSet( win, WF_ICONTITLE, A NULL value removes the
         draw); drawing function.
WF_INFO Set the informative bar text.
WindSet( win, WF_INFO, info);
WF_WORKXYWH Set the window workspace WindSet() takes in
coordinate consideration menu and
WindSet( win, WF_WORKXYWH, toolbar.
         x, y, w, h);
WF_TOP Put the window in foreground. The internal WinDow cycle
WindSet( win, WF_TOP); window is updated (for
or any window (top = handle) WM_BOTTOMED message
WindSet( NULL, WF_TOP, top); emulation).
WF_BEVENT Set the window event behaviour B_MODAL is a WinDom
WindSet( win, WF_BEVENT, val); feature. This mode is
val is a bit field : supported by all TOS.
BEVENT_WORK: a mouse button
event on a window workspace
create a MU_BUTTON event
instead of a WF_TOP event.
BEVENT_MODAL: a window modal is the
only window active.
WF_BOTTOM Set a window in the background This mode is supported
WindSet( win, WF_BOTTOM); by all TOS.
WF_ICONIFY Iconify a window at specified This mode is supported
coordinate. by all TOS.
WindSet( win, WF_ICONIFY,
              x, y, w, h);
WF_UNICONIFY Iconify a window at specified This mode is supported
coordinate. by all TOS.
WindSet( win, WF_UNICONIFY,
              x, y, w, h);
WF_UNICONIFXYWH Set the coordinate of an This mode is supported
iconified window that will be by all TOS.
for the next WF_UNICONIFY
WindSet( win, WF_UNICONIFYXYWH,
              x, y, w, h);
WF_TOOLBAR Put a toolbar in a window and This mode is supported
set eventually the event by all TOS. However WinDom
toolbar function. has its own toolbar
WindSet( win, WF_TOOLBAR, management even when the
              tree, func); system supports the
window toolbar.
WF_MENU Put a menu in a window and set This mode is a specific
eventually the event menu WinDom feature supported
function. by all TOS.
WindSet( win, WF_TOOLBAR,
              tree, func);
WF_HILIGHT When a window menu is visited This mode is a specific
the hilight function is called WinDom feature supported
function. It is typically used by all TOS.
to display an online help on
menun function for example.
WindSet( win, WF_HILIGHT,
              hilight, FUNC);
hilight have the proto :
void (*hilight)(WINDOW *win,
int title, int item);
title is the menu title visited
item is the menu item visited
WF_HSLIDE These mode are obsolets, see
the WindSlider() function
WF_VSLIDE
WF_HSLSIZE
WF_VSLSIZE
other mode WindSet( win, mode, p1, p2, p3 Direct call to wind_set()
              p4);

Notes about toolbar and menu

EvntWindom() draws automatically menu and the toolbar inside a window. The object tree given to WindSet() to define a menu or a toolbar is duplicated in memory using the ObjcDup() function in order to handle a same object tree in several windows. Memory is free up by WindDelete().

SEE ALSO

WindSetStr(), WindSetPtr(), WindGet(), WindSlider(), Frames