From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Gavin McCord Newsgroups: comp.lang.ada Subject: GEntry with autocomplete Date: Mon, 7 Mar 2022 00:06:19 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 7 Mar 2022 00:06:19 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="a828f6db650e19489a3089004b23dc08"; logging-data="22227"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VAJfyTwifekr528YX+N8y45qM5IgYXNT76mpRoJdmSA==" User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git) Cancel-Lock: sha1:jiAyI3HoE5S3KcuCXCP2o8HvTTo= Xref: reader02.eternal-september.org comp.lang.ada:63579 List-Id: I'm looking at including a GEntry with autocomplete in some code of mine, and have created a simple example, test.adb, which I've constructed from tutorial examples (though from other languages, such as Python and PHP). with Gtk.Main; with Gtk.Window; use Gtk.Window; with Gtk.GEntry; use Gtk.Gentry; with Gtk.List_Store; use Gtk.List_Store; with Gtk.Tree_Model; use Gtk.Tree_Model; with Gtk.Entry_Completion; use Gtk.Entry_Completion; with Gtkada.Handlers; use Gtkada.Handlers; with Glib; use Glib; with test_cb; use test_cb; procedure Test is Win : Gtk_Window; Entry_1 : Gtk_GEntry; List_1 : Gtk_Tree_Model; Iter_1 : Gtk_Tree_Iter; Completion_1 : Gtk_Entry_Completion; type Word_Array is Array (1 .. 3) of String (1 .. 5); Words : Word_Array; begin Gtk.Main.Init; Gtk_New (Win); Win.Set_Title ("Window"); Win.On_Delete_Event (main_del'Access); Win.On_Destroy (main_quit'Access); Win.Set_Border_Width (10); Words(1) := "Alpha"; Words(2) := "Bravo"; Words(3) := "Delta"; Gtk_New (List_1, (0 => GType_String)); -- 0 - the first column for Count in 1 .. 3 loop List_1.Append (Iter_1); Set (List_1, Iter_1, 0, Words(Count)); -- 0 The first column end loop; Gtk_New (Completion_1); Completion_1.Set_Model (List_1); Completion_1.Set_Text_Column(0); Gtk_New (Entry_1); Entry_1.Set_Completion(Completion_1); Win.Add (Entry_1); Win.Show_All; Gtk.Main.Main; end Test; Compilation fails at line 40 "Completion_1.Set_Model (List_1)" with the error test.adb:40:28: error: expected private type "Gtk_Tree_Model" defined at gtk-tree_model.ads:195 test.adb:40:28: error: found type "Gtk_List_Store" defined at gtk-list_store.ads:139 Presumably, I've missed something in translation. Thanks for any help. Gavin