Here is a customization we could use:
public int SetActiveText (string text)
{
// returns index that was set; otherwise -1 if it could not
int comboIndex = 0;
string tvalue;
TreeIter iter;
combo.Model.IterChildren (out iter);
tvalue = combo.Model.GetValue (iter, 0).ToString();
if (tvalue.Equals (text)) {
combo.Active = comboIndex;
return comboIndex;
}
else {
bool found = combo.Model.IterNext (ref iter);
while (found == true) {
comboIndex ++;
tvalue = combo.Model.GetValue (iter, 0).ToString();
if (tvalue.Equals (text)) {
combo.Active = comboIndex;
return comboIndex;
}
else
found = combo.Model.IterNext (ref iter);
}
}
return -1; // not found
}
--- Begin Message ---
Can we modify the void AppendText(string) function to return an int.
This int would be the index into the model where the text got inserted.
This way, you could immediately select this entry via proerty Active.
Example:
string text = "Some Text Value";
int appendedIndex = comboBox.AppendText (text);
comboBox.Active = appendedIndex;
Also, what happened to documentation on ComboBox on monodoc on the web?
Other gtk# 1.9.x stuff is missing too. It used to be there.
If we are supposed to be headed that way; we need these docs.
Thanks,
Daniel
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--- End Message ---
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list