From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp1-2.free.fr!not-for-mail Newsgroups: comp.lang.ada X-Mozilla-News-Host: news://news.free.fr:119 From: DrPi <314@drpi.fr> Subject: GtkAda : Trying to derive a widget Date: Thu, 8 Apr 2021 21:27:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Message-ID: <606f5938$0$27421$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 08 Apr 2021 21:27:52 CEST NNTP-Posting-Host: 82.65.30.55 X-Trace: 1617910072 news-1.free.fr 27421 82.65.30.55:60355 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61760 List-Id: Hi, I'm trying to create a GtkAda widget derived from a standard widget. -- debug_panel.ads with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Text_View; use Gtk.Text_View; package Debug_Panel is type Debug_Panel_Record is new Gtk_Scrolled_Window_Record with private; type Debug_Panel is access all Debug_Panel_Record'Class; procedure Gtk_New (Panel : in out Debug_Panel); procedure Initialize (Panel : not null access Debug_Panel_Record'Class); private type Debug_Panel_Record is new Gtk_Scrolled_Window_Record with record Text : Gtk_Text_View; end record; end Debug_Panel; -- debug_panel.adb package body Debug_Panel is procedure Gtk_New (Panel : in out Debug_Panel) is begin Panel := new Debug_Panel_Record; Initialize (Panel); end Gtk_New; procedure Initialize (Panel : not null access Debug_Panel_Record'Class) is begin Gtk.Scrolled_Window.Initialize (Panel); -- Init other widgets end Initialize; end Debug_Panel; When compiling, I get the following error : debug_panel.adb:6:07: ambiguous expression (cannot resolve "Initialize") debug_panel.adb:6:07: possible interpretation at debug_panel.ads:15 debug_panel.adb:6:07: possible interpretation at gtk-scrolled_window.ads:92 The solution might be obvious but I don't understand why this error is raised by the compiler. Any help much appreciated. Nicolas