public MainWindow() : base(Gtk.WindowType.Toplevel) { column1 = new TreeViewColumn("Sentences", cellView1); column1.AddAttribute(cellView1, "text", 0); Build(); treeview1.Model = array1; treeview1.AppendColumn(column1); array1.InsertWithValues(0, "Hello World!!1"); array1.InsertWithValues(1, "How are you ?"); array1.InsertWithValues(2, "English"); array1.InsertWithValues(3, "Rust is fast"); }
private void on_item_inserted(object Sender, ListInsertEventArgs args) { //adauga in store store.InsertWithValues(args.Index, false, args.Value); this.QueueDraw(); }
protected void Replace(object sender, EventArgs e) { array2.Clear(); var sorted = Sort(ref F); for (int i = 0; i < sorted.Count; i++) { array2.InsertWithValues(i, $"P[{i}] = {F[i]}"); } }
protected void Sort(object sender, EventArgs e) { array2.Clear(); BubbleSort(ref Array); for (int i = 0; i < 15; i++) { array2.InsertWithValues(i, $"Array[{i}] = {Array[i]}"); } }
protected void Refresh(object sender, EventArgs e) { array1.Clear(); F.Clear(); for (var i = 0; i < 18; i++) { F.Add(rand.Next(-50, 50)); array1.InsertWithValues(i, $"F[{i}] = {F[i]}"); } }
protected void replace(object sender, EventArgs e) { array2.Clear(); for (var i = 0; i < 18; i++) { if ((0.13 * Math.Pow(F[i], 3) - 2.5 * F[i] + 8) < 0) { array2.InsertWithValues(i, $"P[{i}] = {0.13 * Math.Pow(F[i], 3) - 2.5 * F[i] + 8}"); } } }
protected void refresh(object sender, EventArgs e) { array1.Clear(); var rand = new Random(); for (var i = 0; i < 18; i++) { F[i] = rand.Next(-50, 50); array1.InsertWithValues(i, $"F[{i}] = {F[i]}"); } }
public MainWindow() : base(Gtk.WindowType.Toplevel) { column1 = new TreeViewColumn("Source Arrat", cellView1); column2 = new TreeViewColumn("Sort Array", cellView2); Build(); column1.AddAttribute(cellView1, "text", 0); treeview1.Model = array1; treeview1.AppendColumn(column1); column2.AddAttribute(cellView2, "text", 0); treeview2.Model = array2; treeview2.AppendColumn(column2); Random random = new Random(); for (var i = 0; i < 15; i++) { Array[i] = random.Next(-50, 50); array1.InsertWithValues(i, $"F[{i}] = {Array[i]}"); } }
public void ShowLiveInfo(string liveId, ref XmlNodeList nl, ref ListStore ls, ref TreeView tree){ object [] vals = new object[7]; try{ byte[] imgData = wc.DownloadData(nl [3].InnerText); vals[0] = (Gdk.Pixbuf) new Gdk.Pixbuf (imgData,50,50);//サムネイル }catch{ vals[0] = (Gdk.Pixbuf) new Gdk.Pixbuf("noimage.png",50,50); } // Console.WriteLine (nl [2].InnerText); vals[1] = nl[0].InnerText;//放送タイトル vals[2] = nl[2].InnerText;//コミュニティ名 vals[3] = "0分前"; vals[4] = liveId; vals[5] = DateTime.Now.Ticks; vals[6] = nl[1].InnerText;//コミュニティID var iter = ls.InsertWithValues(1,vals); }