[Gtk-sharp-list] Mono / GTK# program crashing
Ian Finlayson
finlaysoni at gmail.com
Wed Jan 27 08:59:09 EST 2010
Hello,
Sorry, I thought that I had removed this message from the list approval process.
I actually fixed this problem by starting from scratch with the GUI
designer. I had
been adding and removing a lot of components, and it got confused at some point.
Thanks for taking the tome to respond though!
- Ian
On Tue, Jan 26, 2010 at 9:18 PM, Michael Hutchinson
<m.j.hutchinson at gmail.com> wrote:
> On Mon, Jan 18, 2010 at 3:56 PM, Simian Man <finlaysoni at gmail.com> wrote:
>> Hello all, I'm sure this is a simple problem, but as I'm new to C#, GTK, and
>> Monodevelop, I can't seem to figure it out. I started by creating a new GTK#
>> program which gives you a simple skeleton that opens a blank window and
>> nothing else. When I try to add anything at all with the GUI designer,
>> however, the program crashes with:
>>
>> Unhandled Exception: System.NullReferenceException: Object reference not set
>> to an instance of an object
>> at MainWindow.Build () [0x002dd] in
>> /home/ian/projects/congo-paint/gtk-gui/MainWindow.cs:83
>> at MainWindow..ctor () [0x00007] in
>> /home/ian/projects/congo-paint/MainWindow.cs:8
>> at congopaint.MainClass.Main (System.String[] args) [0x00005] in
>> /home/ian/projects/congo-paint/Main.cs:17
>>
>> The line of code in question is:
>>
>> this.menubar1 = ((Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
>> this.menubar1.Name = "menubar1";
>>
>> I'm assuming that this.menubar1 is NULL at this point, but this code was
>> automatically generated by the GUI designer, so I don't know what to do
>> about it. Does anybody have any ideas?
>
> It sounds like a bug in the MonoDevelop code generator. What
> MonoDevelop version are you using?
>
> --
> Michael Hutchinson
> http://mjhutchinson.com
>
More information about the Gtk-sharp-list
mailing list