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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4b27f494a96e0530 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: A community Windows binding Date: 09 Oct 2004 09:20:23 -0400 Organization: Cuivre, Argent, Or Message-ID: References: <2004100600261150073%david@bottoncom> <2smd6iF1mo0mcU1@uni-berlin.de> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1097328041 91619 212.85.156.195 (9 Oct 2004 13:20:41 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 9 Oct 2004 13:20:41 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:4954 Date: 2004-10-09T09:20:23-04:00 Jeffrey Carter writes: > Callbacks and dispatching are essentially the same thing in a > windowing system. You have to write little pieces of code that can be > invoked in any order at any time outside your control. You have to use > global variables extensively for these little pieces of code to > communicate. The code is difficult to read because you have to > understand all these little pieces to understand any part of the > software. In Windex, GWindows, CLAW, and GtkAda, each "little piece of code" has as a parameter the user window type. That type stores all the information needed; no global variables are necessary. I can (with a lot of effort to suppress my normal style :) write messy, hard to read code in Windex, using global variables. But it's certainly not required. > With an event queue approach, one writes standard imperative > software using your standard imperative language (Ada's about the > only one). The code is well structured and easy to read and > understand. MS Windows has an event queue. The core program in Windex, CLAW, and GWindows reads events from the event queue as they become available, and calls the appropriate handler, via dispatching. or optionally via a registered callback in GWindows. The handler may make GUI calls that put other events on the event queue (like "invalidate this rectangle" or "hide this widget"). Some GUI calls call the main event handler directly, rather than going thru the queue. GtkAda is similar, but fewer things go thru the queue, and all handlers are registered callbacks. What is it you are talking about that is different? I guess I should go look at the JEWL code. -- -- Stephe