Dears

I am trying to implement the cellrenderer combo with completion.
I have found a solution for this online but in that solution GTK returns a ComboBox object and not ComboBoxEntry object for me.
Below is a code:

var combosource = InitComboSource();

var cell = new CellRendererCombo();
cell.TextColumn = 0;
cell.EditingStarted += (o, args) => {
     if ( args.Editable is Gtk.ComboBoxEntry ) {
Gtk.ComboBoxEntry editableCmb = args.Editable as Gtk.ComboBoxEntry; // !!!!! Here it never returns a ComboBoxEntry object for me :( It's always a ComboBox.

          if (editableCmb.Entry.Completion == null)
          {
              editableCmb.Entry.Completion = new EntryCompletion();

              ListStore store = new ListStore (typeof (string));
              foreach (var val in comboSource) {
                   store.AppendValues (val.ToString());
              }
              editableCmb.Entry.Completion.Model = store;
              editableCmb.Entry.Completion.TextColumn = 0;
          }
     }
};

_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to