3
Je n'arrive pas à comprendre dans GTK # comment obtenir l'élément sélectionné d'une arborescence. Mon exemple de code: Ici, je charger des données dans tvStockGtk # et treeview: comment obtenir l'élément "sélectionné"?
Gtk.TreeViewColumn marketCol = new Gtk.TreeViewColumn();
marketCol.Title = "Market";
tvstock.AppendColumn(marketCol);
Gtk.TreeIter iter = stockListStore.AppendValues ("Dax30");
stockListStore.AppendValues(iter, "Adidas");
stockListStore.AppendValues(iter, "Commerzbank");
iter = stockListStore.AppendValues ("Cac40");
stockListStore.AppendValues(iter, "Bnp Paribas");
stockListStore.AppendValues(iter, "Veolia");
iter = stockListStore.AppendValues ("FtseMib");
stockListStore.AppendValues(iter, "Fiat");
stockListStore.AppendValues(iter, "Unicredit");
tvstock.Model = stockListStore;
// Create the text cell that will display the artist name
Gtk.CellRendererText marketNameCell = new Gtk.CellRendererText();
// Add the cell to the column
marketCol.PackStart (marketNameCell, true);
// Tell the Cell Renderers which items in the model to display
marketCol.AddAttribute (marketNameCell, "text", 0);
Sur mon OnTvstockRowActivated, comment puis-je obtenir la ligne sélectionnée? Merci