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-Thread: 103376,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.81.200 with SMTP id c8mr3736045pay.1.1353410183057; Tue, 20 Nov 2012 03:16:23 -0800 (PST) Path: s9ni1536pbb.0!nntp.google.com!news.glorb.com!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Tue, 20 Nov 2012 11:16:22 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <8906e1e3-3b18-4b37-ac46-3857db47cea4@googlegroups.com> Mime-Version: 1.0 Injection-Date: Tue, 20 Nov 2012 11:16:22 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="dfff62e1e537b55df42008571c03e0fe"; logging-data="1599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZVYwQtbIefOjEXeHaSPJq3mS+N1Xnq0E=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:TK90ItesGKi5oS8BrQAOtjlyCeg= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-11-20T11:16:22+00:00 List-Id: On Mon, 19 Nov 2012 12:22:21 -0800, ake.ragnar.dahlgren wrote: > On Monday, November 19, 2012 10:59:42 AM UTC+1, ake.ragna...@gmail.com > wrote: >> This problem has it's origin in the implementation of the MVC pattern >> for a GtkAda application. Consider the following: ... > Additional information if needed: The spec. of the Register_Handler > procedure in the Gtkada.Builder package is declared as: > > procedure Register_Handler > (Builder : access Gtkada_Builder_Record'Class; > Handler_Name : String; > Handler : Builder_Handler); Okay, this is looking familiar... A previous post of mine linked at the bottom of the ada.dk tutorial contains the comment : -- Having only Gtkada_Builder_Record'Class and GObject_Record'Class -- seems restrictive. I failed to find any way to register and use -- the following: -- procedure Destroy(Object : access Gtk_Widget_Record'Class); -- eventually resorting to Gtk.Builder.Get_Widget in the procedure body. -- I must be missing something here... To expand on that; clearly everything is a subclass of GObject_Record, and therefore the intent must be that anything more complex like your On_Quit example be registered as an Object_Handler not a Builder_Handler. -- type Builder_Handler is access procedure -- (Builder : access Gtkada_Builder_Record'Class); -- type Object_Handler is access procedure -- (User_Data : access GObject_Record'Class); The remaining question would be ... how? It might be worth putting your On_Quit handler into the tutorial example, and asking "How do I register this as an Object_Handler?" on the GtkAda mailing list. - Brian