[Gtk-sharp-list] Bug in Gtk.Style

Duncan Mak duncan@ximian.com
21 Sep 2002 00:55:49 -0400


Heya,

I'm trying to run Miguel's mphoto and it crashes for me only when I try
to run it with a theme other than the default:

TIE: System.NullReferenceException: A null value was found where an
object instance was required
in <0x00067> 00 Gtk.Widget:get_Style ()
in <0x000e7> 00 .IconList:DrawCell (int,int,int)
in <0x00065> 00 .IconList:DrawAll ()
in <0x00078> 00 .IconList:ExposeHandler
(object,GtkSharp.ExposeEventArgs)
in <0x0004d> 04 .IconList:ExposeHandler (object,intptr,intptr)
in (unmanaged) 06 System.Reflection.MonoMethod:InternalInvoke
(object,object[])
in <0x00004> 06 System.Reflection.MonoMethod:InternalInvoke
(object,object[])
in <0x0009e> 00 System.Reflection.MonoMethod:Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)

I tracked it down to this line of code:

image.RenderToDrawable (window, Style.WhiteGC,
			0, 0, x, y, image.Width, image.Height, 			Gdk.RgbDither.None, 0, 0);

and the exception is coming from the call for 'Style.WhiteGC'.

-- 
Duncan Mak <duncan@ximian.com>