From: Foster T. B. <fbr...@ad...> - 2006-01-30 22:26:28
|
On Jan 30, 2006, at 01:58p, Tom Pinkerton wrote: > Hi All, > > While digging into my Qt implementation of the widgets library, > I've noticed > that a widget's parent appears to be set after the underlying platform > widget itself is created. On MacOS this is not a problem because a > control > can be initially created without a parent. However, the existing > Windows > implementation uses some kind of 'invisible parent' member as an > initial > parent when a control is created. In Qt, like on Windows, a widget > needs a > parent at creation time, so I'm wondering if I will need a similar > 'invisible parent' mechanism for my Qt implementation. Yes, you will need to do the same for Qt. > Does Eve somehow rely > upon setting the parent after a widget is initially created? Yes -- this is due to the fact that the widgets themselves aren't supposed to manage their child-parent relationships; this is modeled currently by the separation of the ui_core from the display code. The display's intent is to manage parent/child relationships within the visual heirarchy, completely separate from the widgets themselves. A widget is first created in the ui_core, then it is attached to the visual hierarchy through the display code. Thus, it must exist before it can be attached, requiring the invisible window for platforms where widgets must be contained by a window at all times. > Is the sole > purpose of the display_t object to provide a way to set the > widget's parent > hierarchy? Yes. Sean had other justifications for the display code, but I can't remember them currently. > Will the parent hierarchy ever change for a given Eve layout > after the initial layout is created? No -- the description of the layout specifies the hierarchy, and it is parsed only when the view is first created. Ralph Thomas has done some work with populating parents dynamically with children as an optimization (e.g., only populating a scrollable list of image thumbnails with those thumbs that are currently in the view clipping rect) but it's not a part of ASL currently. Note this is a different behavior from hiding and showing widgets, however (which is something we do support). Keep the questions coming! Blessings, Foster -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "The fact is that the author of STL does not know how to write min, the author of C++ is not quite sure, and the standards committee is at a loss." -- Alexander Stepanov |