// load the phone book
// Since we have SelectionMode.Multiple turned on we have to
// jump through these hoops in GTK-2.0 to get a selection
private void on_book_treeview_selection(object o, EventArgs args)
{
Gtk.TreeIter iter = new Gtk.TreeIter();
//Value value = new Value(); delete me
string selectionText = null;
book_store.GetIterFirst(out iter);
if (book.Selection.IterIsSelected(iter))
{
selectionText = (string)book_store.GetValue(iter, 0);
}
while (book_store.IterNext(ref iter))
{
if (book.Selection.IterIsSelected(iter))
{
selectionText = (string)book_store.GetValue(iter, 0);
}
}
// Ok now we can finally load the phone book
foreach (Phonebook p in myPhoneBooks)
{
if (p.Name == selectionText)
{
load_phone_book(p);
}
}
}