Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!pcrat!rick From: rick@pcrat.uucp (Rick Richardson) Newsgroups: comp.windows.x Subject: Incremental Display of Widget Tree Message-ID: <1990Aug8.025339.3419@pcrat.uucp> Date: 8 Aug 90 02:53:39 GMT Organization: PC Research, Inc. Lines: 68 I want to create a Box (or RowColumn in Motif) widget that contains a bunch of Command (or PushButton in Motif) widgets. But with a twist. The labels on the buttons themselves take anywhere from 1-3 seconds apiece to compute, and are information that the user can read in and of themselves. The buttons represent pages of a document. As each button widget is created, I'd like to process events ala XtMainLoop, but only until I'm sure the newly created button has been displayed. Once the button is displayed, I need to continue parsing an input file until the next button is ready to be added and displayed. I want to do this displaying as each button is created so that the user has something to look at and think about rather than a dumb hourglass or Please Wait message. I've scoped out the pseudo code, as indicated below, but there are a few things I haven't figured out how to do, marked by ***'s. Does anybody have any ideas or pointers on how I can accomplish this? Is there some event I have to wait for that says that everything created so far has been displayed? What is it? main # main program { - box = XtCreateManagedWidget( ...Box..., toplevel, ... ) (and other widgets) - XtRealizeWidget(toplevel) - Now, process events until widgets are displayed **** How do I do this **** - call parse(document) - call regular XtMainLoop() } parse_ready # called from "parse", usually many times { - button[n++] = XtCreateManagedWidget( ...Command..., box, ... ) The 'label' on this button is information in itself. - XtRealizeWidget(button[n++]) *** is this correct? *** - Now, process events until this new button has been fully displayed. *** how do I do this *** - return back to parse(); } parse { While there are more pages to process { - format the page (somewhat CPU intensive) - call parse_ready } } -Rick -- Rick Richardson - PC Research, Inc., uunet!pcrat!rick, (201) 389-8963