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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Where do I get my Cairo context from (in GTK3)? Date: Mon, 25 Apr 2016 13:58:07 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: G7MXAklp0OAVRSdfcmpxRQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:30275 Date: 2016-04-25T13:58:07+02:00 List-Id: On 25/04/2016 12:03, hreba wrote: > On 04/25/2016 09:40 AM, Dmitry A. Kazakov wrote: > >> If you instantiate it with GObject, why using Gtk_Widget instead? > > I use Glade and Gtk_Builder.Get_Object returns GObject. Nearly all > examples for handler connection use Gtk_Widget so I did the same. But it is still GObject_Record. >> I suppose sn_draw is "draw". >> > Correct. Is it Signal_Name in Connect? Recent GtkAda changes broke a lot of things. Try a plain string literal instead. >>> So where do I get the cairo context from? >> >> As you did. Just make sure that all parameters of Connect match. Instead >> of pointer conversion use object conversion. E.g. >> >> Gtk_Widget_Record'Class (Obj.all)'Unchecked_Access > > So I changed my call of Connect to > > DA_Ret_Callback.Connect > (Gtk.Widget.Gtk_Widget_Record'Class(obj.all)'Unchecked_Access, > sn_draw, > DA_Ret_Callback.To_Marshaller(Draw_Handler'Access), > hd); > > but I still get the same error message from the compiler. Try to specify a concrete marshaller in conversion, to narrow the problem. To_Marshaler is a renaming. Use the original full name from the marshaler package that instantiates the Draw's profile. You have a type mismatch in some of the parameters. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de