Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=1d954ef109946e21462612779a13b89f8ee8b542

commit 1d954ef109946e21462612779a13b89f8ee8b542
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Thu Aug 26 16:57:20 2010 +0000

*added event for treeview selection

diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 5eac911..9e4522c 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -25,13 +25,15 @@ using frugalmonotools;

public partial class MainWindow : Gtk.Window
{
+       protected Gtk.TreeIter iter;
+
//pacman-g2
// Create a model for treeview pkg
Gtk.ListStore pkgListStore = new Gtk.ListStore (typeof (string));
//pacman-g2 initialise
PacmanG2 Pkg = new PacmanG2();
ListStore modelRepoList = new ListStore (typeof (string),typeof (int));
-
+

//webkit engine
private WebKit.WebView webview=null;
@@ -81,6 +83,9 @@ public partial class MainWindow : Gtk.Window
// Assign the model to the TreeView
treeviewpkg.Model = pkgListStore;

+               // Event on treeview
+               treeviewpkg.Selection.Changed += OnSelectionEntryPkg;
+
//webkit engine
webview = new WebView();
scroll.Add(webview);
@@ -491,6 +496,23 @@ public partial class MainWindow : Gtk.Window
}


+       protected void OnSelectionEntryPkg(object o, EventArgs args)
+           {
+                       try
+                       {
+                               TreeModel model;
+                                if (((TreeSelection)o).GetSelected(out model, 
out iter))
+                       {
+                           string T =(string)model.GetValue (iter, 0);
+                                       Console.WriteLine(T);
+                               }
+                       }
+                       catch{}
+               }
+
+
+
+


_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to