Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!CRC2.SKL.DND.CA!Eric.Rosenquist From: Eric.Rosenquist@CRC2.SKL.DND.CA Newsgroups: comp.windows.x.motif Subject: XtDestroyWidget & Gadgets Message-ID: <9010111926.AA01346@crc.skl.dnd.ca> Date: 11 Oct 90 19:28:08 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Eric.Rosenquist@crc2.skl.dnd.ca Distribution: inet Organization: The Internet Lines: 52 This may well be a candidate for the frequently-asked-questions list, but since I didn't see an answer in the messages I've collected over the past few months I'm asking anyway: I'm having some trouble with XmToggleButtonGadgets. I put up a simple dialog that's a couple of nested RowColumn widgets, each of which has some ToggleButtonGadgets as its children. All is fine until I try to destroy the tree via XtDestroyWidget(on the dialog shell), at which point I get a core dump. If I use regular XmToggleButton widgets rather than gadgets everything is fine. The core dump occurs in the delayed clean-up activity. Here's a trace, it's not very instructive to me since we don't have Motif source (this is on 386/ix with Motif 1.0 by the way): Warning: `test' not compiled with -g 0x19956 in ProcessMenuTree:No lines in file *ProcessMenuTree(1,0x447be0,0x446420,1) [RowColumn.c] ProcessMenuTree(0x447be0,0x447be0,0x446420,1) [RowColumn.c] _XmProcessMenuTree(0x447be0,1) [RowColumn.c] ConstraintDestroy(0x447be0) [RowColumn.c] Phase2Destroy(0x447be0) [Destroy.c] Recursive(0x447be0,0x4e6e8) [Destroy.c] Recursive(0x4465f4,0x4e6e8) [Destroy.c] Recursive(0x446420,0x4e6e8) [Destroy.c] Recursive(0x4459d0,0x4e6e8) [Destroy.c] XtPhase2Destroy(0x4459d0,0,0) [Destroy.c] _XtCallCallbacks(0x7ffffe20,0) [Callback.c] XtDispatchEvent(0x7ffffe38) [Event.c] XtAppMainLoop(0x428ddc) [Event.c] XtMainLoop() [Event.c] main(1,0x7ffffed0,0x7ffffed8) [test.c] For now I'm assuming that this is just another quirk of gadgets and am suffering along with the slower non-gadget variety, but I'd like to know if this is supposed to work or not. As an aside, I haven't seen any info in the Motif docs regarding the when's & why's of destroying widgets. What I've been doing is keeping dialogs around (just unmanaging them) if there's only one instance of them and there's a good chance they'll be needed again later. For dialogs that can have any number of instantiations, it makes sense to me to destroy them when they're closed, thereby freeing the memory they occupy. Out of curiosity, what are the rest of you doing? Eric -- Eric.Rosenquist@crc.skl.dnd.ca Software Kinetics Limited 65 Iber Road, Stittsville, Ontario Canada - K2S 1E7 Phone (613) 831-0888