Supported Browsers Home   
MGL_wmSetWindowCursor Previous   
MGL_wmSetWindowFlags Next   
External Functions Up   

MGL_wmSetWindowDestructor

Sets window's destructor callback.

Declaration

void MGLAPI MGL_wmSetWindowDestructor(
    window_t *wnd,
    windtor_t dtor)
typedef void (MGLAPIP windtor_t)(struct window_t *wnd)

Prototype In

mgraph.h

Parameters

wnd

the window

dtor

the destructor callback

 

Description

Use this function to set window's destructor callback. The destructor is called by MGL_wmDestroyWindow before destroying children and deallocating window_t structure. This function gives you a chance to react to window destruction (for example by freeing data set with MGL_wmSetWindowUserData).

Note:    Remember that you don't always destroy windows with MGL_wmDestroyWindow; some windows are destroyed “implicitly”. This happens when you call MGL_wmDestroyWindow on window that itself has child windows. Children are recursively destroyed and destructor callback is the only way to notify your code about it. As a special case, this also happens in MGL_wmDestroy because it calls MGL_wmDestroyWindow on the root window.

See Also

MGL_wmDestroyWindow, MGL_wmSetWindowUserData

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