void HandleBtSearchGoClicked(object sender, EventArgs e) { tvResults.Destroy(); tvResults = new TreeView (); Console.WriteLine("Searched: "+tbSearch.Text); staff staffMember = new staff(); staffMember.fName = "ted"; List<staff> searchResults = new List<staff> (); searchResults = staffMember.search_staff(tbSearch.Text); Console.WriteLine("Search Results found: "+searchResults.Count.ToString()); //staffMember.get_staff_member(); foreach(staff sr in searchResults) { Console.WriteLine(sr.fName+" "+sr.lName); } //Console.WriteLine(staffMember.fName); Gtk.ListStore searchResultsStore = new Gtk.ListStore (typeof (string)); searchResultsStore.AppendValues ("Gerry"); Gtk.CellRendererText staffResult = new Gtk.CellRendererText (); tvResults.Model = searchResultsStore; vboxVpLeft.PackStart(tvResults); TreeViewColumn tvcName = new TreeViewColumn (); tvcName.Title="Name"; tvcName.PackStart(staffResult,true); tvResults.AppendColumn(tvcName); tvcName.AddAttribute (staffResult, "text", 0); tvResults.Show(); vboxVpLeft.PackStart(tvResults); }
void HandleTbSearchKeyReleaseEvent(object o, KeyReleaseEventArgs args) { //get results live on key up staff staffMember = new staff(); staffMember.fName = "ted"; List<staff> searchResults = new List<staff> (); searchResults = staffMember.search_staff(tbSearch.Text); Console.WriteLine("Search Results found: "+searchResults.Count.ToString()); //staffMember.get_staff_member(); foreach(staff sr in searchResults) { Console.WriteLine(sr.fName+" "+sr.lName); } }