Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!ucsd!ucbvax!bloom-beacon!APS1.SPA.UMN.EDU!zoo From: zoo@APS1.SPA.UMN.EDU ("david d [zoo] zuhn") Newsgroups: comp.windows.x Subject: Re: Xt and the Destroy method Message-ID: <9008081301.AA07125@armadillo.spa.umn.edu> Date: 8 Aug 90 13:01:58 GMT References: <9008081235.AA18633@lyre.MIT.EDU> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 27 Ralph Swick writes: > If I call XtDestroyWidget on the top > level widget, and call this during my exit routine, everything dies > nicely, except that the Destroy method is NOT called. If I try > XtDestroyWidget directly on the widget, and not going through the top > level, the same thing happens. > > Don't forget that widget destruction happens in 2 phases. If you > call XtDestroyWidget while XtDispatchEvent is active the cleanup > is deferred until the very last stage of XtDispatchEvent, just before > it returns. If the application exits before returning to XtDispatchEvent > then the destroy methods will never be invoked. > > This is done so that applications can write callback procedures > and action procedures without having to worry about data structures > disappearing from underneath them. This is indeed the case. My exit() call was getting in the way here. When I just called XtDestroyWidget on the widget, but did not exit the application, my Destroy method was called. This is what happens when test programs are too simple sometimes. Thanks Ralph. Zoo