From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e429176c9adb07b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-21 09:29:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E5661F0.2060200@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [OT] Best way to isolate a GUI? (The final concensous?) References: <3E511C15.1040404@acm.org> <3E5121BD.4010200@cogeco.ca> <3E51A55A.3000101@cogeco.ca> <3E52A1BF.1020809@cogeco.ca> <3E53CE60.1030008@cogeco.ca> <3E55501D.9050006@cogeco.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 21 Feb 2003 17:27:58 GMT NNTP-Posting-Host: 63.184.9.36 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1045848478 63.184.9.36 (Fri, 21 Feb 2003 09:27:58 PST) NNTP-Posting-Date: Fri, 21 Feb 2003 09:27:58 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:34351 Date: 2003-02-21T17:27:58+00:00 List-Id: Marin David Condic wrote: > Well, if you use an existing GUI such as Windows or Motif, you are > *going* to have callbacks. I'd prefer to isolate them in some kind of > wrapper layer and have the "real" app receive messages of some sort. > If you were building a GUI from bottom dead center, you could build > that sort of thing right in. I'm just saying I think that callbacks > are an ugly kludge that I'd prefer were done a different way. You > might be able to get there with existing GUIs & glue or wrappers or > skins or whatever you like to call it. Just expressing a desire to > see an interface to a GUI that doesn't have to know anything about > the code *I* write. :-) This is about what I was trying to say. I mentioned the idea of having a task per window to emphasize the inherent concurrency of multiple windows, and some posters seem to have fixated on tasks rather than on the message (event) queue that was really what I was talking about. You can see an example of this, built on top of Windows, in JEWL. Because it's intended for beginners, it's rather too simple for a complete windowing system, but it does show how a GUI can be designed using events ("commands" in JEWL parlance) rather than callbacks. It doesn't prevent you from having dynamic windows or dialogs, nor does it force you to use tasks. It does let you structure your system the way you want, and control what it does, rather than structuring it for the convenience of the windowing system, and giving control to that system. This alone makes the software much easier to read and understand. -- Jeff Carter "If you don't get the President of the United States on that phone, ... you're going to have to answer to the Coca-Cola Company." Dr. Strangelove