Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!polyslo!mpatnode From: mpatnode@polyslo.CalPoly.EDU (Dodger) Newsgroups: comp.windows.x Subject: Re: REPARENTING WIDGETS Message-ID: <11811@polyslo.CalPoly.EDU> Date: 7 Jun 89 21:02:21 GMT Reply-To: mpatnode@polyslo.CalPoly.EDU (Mike Patnode) Distribution: na Organization: Cal Poly Academic Computing Services, San Luis Obispo Lines: 34 In article <8906070106.AA18157@expo.lcs.mit.edu> ISSLCK@NUSVM.BITNET (Law Chee Keong) writes: >Hi! Hello >There seems to be no easy way of doing this short of making a copy of the >widget, then using XtDestroyWidget to remove it from its parent, then adding >the copy of the widget to the new parent. Yup that's it. I was working on this for a while and this method is virtually impossible unless you happen to be keeping track of all the widgets attributes via a widget independent method. (which we were) If you try to copy attributes from a widget to another (which I did), you will discover a plithera of bugs and inconsistencies in the XtGetValues() implementations of different widget classes. I did find performace to be acceptable for the Destroy-Create method, even with child-bearing composite widgets. The trick is to realize all the children before mapping the parent. A Copy ability would be very nice if it was intrinsic to the widgets. It turns out to be a big sore spot which says "I'm not a object-oriented as I pretend to be." I think this problem lies in the C language itself and current solutions have been stretched to the limit. BUT, I'm not about to switch to Interviews quite yet... Any hope of a XtCopyWidget() in a future release? ---------- -- Mike "Dodger" Patnode | mike@cosmos.ACS.CalPoly.EDU Yitbos Innovations Inc. | or 244 California Blvd | mpatnode@polyslo.CalPoly.EDU San Luis Obispo, Ca 92630 | (805) 541-2048 / 543-9818 / 756-2516