Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!m2c!ernie.viewlogic.com!news From: josh@concept.viewlogic.com (Josh Marantz) Newsgroups: comp.windows.x Subject: Reparenting widgets in Xt Intrinsics Message-ID: <1991Feb27.161015.12890@viewlogic.com> Date: 27 Feb 91 16:10:15 GMT Sender: news@viewlogic.com (News Administrator) Organization: Viewlogic Systems, Inc. Lines: 32 There are times when I'd like to build a widget hierarchy bottom-up. But the basic XtCreateWidget call takes the parent as a formal parameter, implying what widget hierarchies must be created top-down. I have two questions for the Intrinsics experts: 1. Can NULL be specified as a parent at creation time, and re-set once the parent has been created? There is an XtParent(). Is there something like XtSetParent, or XtSetArg(arg, XtNparent, parent)? 2. What is the reasoning behind mandating that widget hierarchies be created top-down? To me, Bottom-up has two advantages: 1. You could create hiearchies with a C expression that syntactically reflected the hierarchy: menu = create_menu (create_entry ("File", ...), create_entry ("Edit", ...), create_entry ("View", ...), create_entry ("Help", ...), ... NULL); 2. By the time the real top-level window was created, all component widget sizes would be known, and if constraint windows could determine their appropriate size before the call to XCreateWindow. (I know this is handled in Xt by the multi-phase Create-Manage-Realize strategy). I'm curious as to why this approach was taken. -- Joshua Marantz Viewlogic Systems, Inc. josh@viewlogic.com Why not pass the time by playing a little solitaire?