MGL_wmCreate

Creates window manager object and attaches it to device context.

Declaration

winmng_t* MGLAPI MGL_wmCreate(
MGLDC *dc)

Prototype In

mgraph.h

Parameters

dc | display device context to associate with window manager.

Return Value

Window manager object or NULL on error

Description

This function creates window manager object. MGL WM provides functionality similar to that of Xlib, i.e. bare minimum needed to implement windowing environment on top of SciTech MGL. That is, it manages hierarchy of rectangular windows, takes care of proper repainting (but you must provide painter functions for all windows) and clipping and distributes input events among the windows.

In addition to allocating winmng_t object, this function also creates the root window (which is top-level window that covers entire DC area and that is at the top of windows hierarchy). Root window is accessible via MGL_wmGetRootWindow. It also sets the root window visible and shows mouse cursor.

You must create winmng_t object with this function before you can use MGL WM.

Note: You shouldn't draw to the device context associated with window manager yourself. Use MGL WM functions MGL_wmBeginPaint and MGL_wmSetWindowPainter instead.

Note: MGL_wmCreate doesn't set root window's painter method. You must do it yourself, preferably immediately after creating the winmng_t object.

See Also

MGL_wmDestroy, MGL_wmCreateWindow, MGL_wmUpdateDC, MGL_wmGetRootWindow, MGL_wmProcessEvent

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com