Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!west!runcible.West.Sun.COM!lwake From: lwake@runcible.West.Sun.COM (Larry Wake) Newsgroups: comp.windows.open-look Subject: Re: XView Programming Style Keywords: XView Message-ID: <1573@west.West.Sun.COM> Date: 2 Apr 91 02:01:19 GMT References: <1991Mar13.193948.16328@sol.UVic.CA> <7207@ecs.soton.ac.uk> <1552@west.West.Sun.COM> <1991Apr1.200322.12740@cshl.org> Sender: news@west.West.Sun.COM Organization: Sun Microsystems, San Diego, CA Lines: 52 >In article <1552@west.West.Sun.COM> I wrote: >> "As a rule, create resources such as pop-ups only at the time they are >> required." >> >>If you think about it, this makes a lot of sense. For example, in an >>application I'm writing there are nine windows, including the main >>window, with more possibly to come. However, I figure the average user >>will use four of those with any frequency; the other four they may never >>use. >> And in article <1991Apr1.200322.12740@cshl.org> monardo@cshl.org (Pat Monardo) replies: >these are canvases (i assume). Nope, panels. >... the rule seems to me to a bit vague. some questions i have >are: What is a pop-up? In this context, I've been using it as "any window that's not the base window" (this is how devGuide uses the term, too), but it could cover menus and such as well. >Does the size of the application matter? That depends. As someone before me said, "good programming practice scales." Or something like that. I think it's always a good idea not to commit resources until they're used, since it's possible they might never be needed at all. In the case of my application, I see the two choices as being: Create main window Create eight pop-up windows, but don't show them enter main event loop (handle events; update and show windows as needed) versus Create main window enter main event loop (handle events; create, update and show windows as needed) To me, the latter style is very natural, easy to write, and doesn't use up resources that may never be called on. It also gets us to the main event loop that much faster, making your application feel faster to the user. Unless you're keeping some kind of application-related state in your pop-up window structures, I don't see much of a downside to doing it this way. -- Larry Wake, Sun Microsystems (larry.wake@west.sun.com) "Father McGrath! I thought you were dead!" "I was!"