Window is a widget that owns an event queue and that can have a canvas through which an application can render to the window. Window also acts as a parent for sub windows and gadgets. A window may also have a geometry manager, for managing the layout of its sub windows and gadgets.
The class is defined in inc/oops/r3window.h
header file.
Every GUI application must have a main window. To create a main window:
#include <oops/r3window.h> R3OBJ *mainwin; mainwin = R3New(R3CLID_WINDOW, R3WA_SubClass, R3SUBCL_MAINWINDOW, R3WA_Title, "my application", R3WA_CloseGadget, TRUE, R3WA_Zoom, TRUE, R3WA_SizeGadget, TRUE, R3WA_DragBar, TRUE, ..., R3TAG_END);
To create a child window for the main window:
subwin = R3New(R3CLID_WINDOW, R3WGA_Parent, mainwindow, R3WA_SubClass, R3SUBCL_SUBWINDOW, .... R3TAG_END);
The parent-child relation ship is defined by using the R3WGA_Parent attribute. The main window is the top level window in application and the only window who doesn't have parent.
There are three kind of sub windows:
R3WASUBCL_NORMAL - Floating window.
R3WASUBCL_SUBWINDOW - child window
R3WASUBCL_SCROLLEDSUBWINDOW - scrollable child window
The window class defines large number of options and methods which allow you to create and manage all possible type of windows one might need. The 'samples/kernel/' folder contains numerous examples demonstrating window class..