[gtkada] Cell_Renderer_Combo: how to act on characters typed to show match in combo
Op de Coul, Manuel
Manuel.op.de.Coul at uniper.energy
Thu Apr 26 11:52:59 CEST 2018
Hoi Rob,
with Gtk.Entry_Completion; use Gtk.Entry_Completion;
Result : Gtk_Entry;
List : Gtk_List_Store;
Compl : Gtk_Entry_Completion;
Iter : Gtk.Tree_Model.Gtk_Tree_Iter;
Gtk_New (List, GType_Array'(GType_String, GType_String)); --example with two columns
-- fill this list with your items for example:
Append (List, Iter);
Set (List, Iter, 0, "item 1");
--create your combo box and renderer(s)
--create the entry completion
Result := Get_Entry (The_Combo);
Gtk_New (Compl);
Set_Model (Compl, Gtk.Tree_Model.Gtk_Tree_Model(List));
Set_Text_Column (Compl, 0);
Set_Text_Column (Compl, 1);
Set_Property (Compl, Text_Column_Property, 0);
Set_Inline_Completion (Compl, True);
Set_Popup_Single_Match (Compl, False);
Set_Completion (Result, Compl);
Unref (List);
Unref (Compl);
Combo_Box_Callback.Connect (The_Combo, "changed",
Combo_Box_Callback.To_Marshaller (On_The_Combo_Changed'Access));
--end
Greetings,
Manuel
-----Original Message-----
From: gtkada-bounces at lists.adacore.com [mailto:gtkada-bounces at lists.adacore.com] On Behalf Of Rob Groen
Sent: woensdag 25 april 2018 9:20
To: gtkada at lists.adacore.com
Subject: [gtkada] Cell_Renderer_Combo: how to act on characters typed to show match in combo
Hello,
With a Cell_Renderer_Combo in a Tree_View I would like to act on typed characters and show the nearest match in the Combo. The Cell_Renderer_Combo has the property Has_Entry_Property set to True.
However, I don't see an appropriate signal to react on, nor any way to get to the entry and associated buffer; that is needed to show the non-typed part of the match as being selected.
How can I do this with Gtkada?
Regards
Rob Groen
_______________________________________________
gtkada mailing list
gtkada at lists.adacore.com
/no-more-mailman.html
More information about the gtkada
mailing list