[Gtk-sharp-list] Is there any way to check if the size of TreeViewColumn has changed?

Peter Johanson latexer at gentoo.org
Sun Jul 9 15:05:33 EDT 2006


On Sun, Jul 09, 2006 at 09:27:08AM -0700, GeSe wrote:
> 
> Hi, 
> I am looking for a way to determine if the size of a TreeViewColumn has been
> changed by the user. 
> Is there some sort of event for this particular case? I have already looked
> in the documentation but I haven't found anything. 
> Maybe you guys can help me with this annoying problem.

You should be able to use column.AddNotification ("width", new delegate () { /* handle resizing */ });

Sample boo script that does what I'm talking about attached.

-pete
-------------- next part --------------

import Gtk from 'gtk-sharp'
import GLib from 'glib-sharp'
import System

Application.Init ()

w = Window ('test')
w.DeleteEvent += { Application.Quit (); }
store = ListStore (typeof (string), typeof (string))
store.AppendValues ("test string", 'string 2')

tv = TreeView ()
tv.Model = store
col1 = tv.AppendColumn ("string1",
		CellRendererText (),
		"text", 0
		)

col1.Resizable = true
col1.AddNotification ("width", { print 'resized!' })

col2 = tv.AppendColumn ("string2",
		CellRendererText (),
		"text", 1
		)
col2.Resizable = true

w.Add (tv)
w.ShowAll ()

Application.Run ()



More information about the Gtk-sharp-list mailing list