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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.74.79 with SMTP id r15mr127326wiv.4.1354573012570; Mon, 03 Dec 2012 14:16:52 -0800 (PST) Path: i11ni9233wiw.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Mon, 3 Dec 2012 23:15:50 +0100 Organization: cbb software GmbH Message-ID: References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <6344b2a2-6ce5-4381-ad41-8dc4bf47902f@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: kWJV5lTRAyCzy8lsfOrlcw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-12-03T23:15:50+01:00 List-Id: On Mon, 3 Dec 2012 12:21:45 -0800 (PST), ake.ragnar.dahlgren@gmail.com wrote: > However, I am currently toying with > the idea of making Gtkada applications using Glade-3 which is very > similiar but a little bit different. My condolences... >> 2. What is the problem? >> >> Why handling Quit signal requires MVC, especially, because there is no such >> >> signal, AFAIK? > > There are two problems that together would require one to structure the > code as I have done. > > 1) Automated tests (AUnit). The code should be testable. GUI is non-testable, too many states, some states are ill-defined, some are real time dependent. > Perhaps one would > like to have a test that verifies that Gtk.Main.Main_Quit is called when > the "destroy" event of Gtk_Object_Record is triggered from the main window > and so on. To make the code testable one needs to separate the GUI code > from the logic somehow. That would be a GTK test = not a test of your code. > 2) Perhaps one would like two have two views who are "connected" to the > same controller instance (code reusability). It is no problem at all. In the sample I provided the event handler takes the window to destroy as a parameter. > Not that I have in mind an actual real world application that would > require two identical windows, but of theoretical interest. It is possible > in other languages, and I'm thinking why not Ada? It is already the way you wanted. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de