Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!ece-csc!ncrcae!ncr-sd!hp-sdd!hplabs!ucbvax!CS.UCLA.EDU!bilbo.geoff From: bilbo.geoff@CS.UCLA.EDU (Geoff Kuenning) Newsgroups: comp.windows.x Subject: Toplevel widget's geometry manager Message-ID: <8711030020.AA11296@lanai.cs.ucla.edu> Date: Mon, 2-Nov-87 19:20:23 EST Article-I.D.: lanai.8711030020.AA11296 Posted: Mon Nov 2 19:20:23 1987 Date-Received: Sun, 8-Nov-87 11:21:31 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 31 Okay, so I played around with the new toolkit and figured out how to write a new widget. The new toolkit's pretty neat, though somewhat limited by the realities of the C language. But now I want to put a bunch of widgets (e.g., menus) around the borders of a window, the center of which is graphics. The proper solution to this, of course, is to write a handy composite widget with geometry manager that magically handles the layout of the various widgets exactly the way I want. This is nontrivial, of course. A simpler solution is just to hardwire widget positions into some composite widget that has a dumber geometry manager. It though of using the Toplevel widget as the composite widget. However, looking at the Toplevel widget's code shows that it can really only handle a single subwidget, and it restricts that widget's geometry fairly strongly. I think that Toplevel should have a very cooperative geometry manager. It should always endeavor to do exactly what a child asks with a minimum of changes and a minimum of features. x/y/width/height requests should be obeyed verbatim; the only special processing is that the Toplevel window should dynamically expand and shrink to reflect the largest extents of any of its children. This will make it easy to decorate a test window with widgets during early development. I have written a widget, called "Obedient," which implements such a scheme. It's pretty easy. What do other people think about this approach? Geoff Kuenning geoff@lcc.ucla.edu geoff@ITcorp.com