[Gtk-sharp-list] setting Container.FocusChain to null.

Peter Johanson latexer at gentoo.org
Mon Nov 7 18:08:28 EST 2005

Hey all,

Ran into this when I made an incorrect assumption about how to use
Gtk.Container.FocusChain. Currently, setting this to null causes a null
ref exception. At the least a check for null should be added. It also
seems to me that adding the behavior of "setting FocusChain = null is
the same as unsetting the focus chain" makes sense. Attached is a small patch
that implements that logic.

This make sense to do? Stupid idea?



Peter Johanson
<latexer at gentoo.org>
-------------- next part --------------
Index: gtk/Container.custom
--- gtk/Container.custom	(revision 52666)
+++ gtk/Container.custom	(working copy)
@@ -92,6 +92,11 @@
 		return result;
 	set {
+		if (value == null) {
+			gtk_container_unset_focus_chain (Handle);
+			return;
+		}
 		GLib.List list = new GLib.List (IntPtr.Zero);
 		foreach (Widget val in value)
 			list.Append (val.Handle);

More information about the Gtk-sharp-list mailing list