[Gtk-sharp-list] Glade - problem when menu entries specified

Viktor Stansvik vstansvik@home.se
Wed, 16 Jun 2004 20:12:14 +0200


ons 2004-06-16 klockan 18.10 skrev Mike Kestner:
> On Wed, 2004-06-16 at 09:12, Viktor Stansvik wrote:
> > Hi. I'm using Gtk# and Glade to build a TV-list application, and have
> > ran into a problem.
> > Everything works fine, unless I add entries to my MenuBar or my
> > OptionMenu with Glade. The app compiles but when I run it I get the
> > following error messages:
> 
> My guess is that you are using Gtk.Application.Init and glade is
> sticking Gnome.Stock items in your menu, which causes libglade to go
> through some gnomeui code which isn't initialized.
> 
> Yes, glade is happy to put Gnome stock items in your menus even if you
> tell it you are creating a Gtk-only project.
I tried to add "using Gnome" to my program and add gnome-sharp to my
references but I still got the same problem.
Then I tried to add only one non-stock item to my MenuBar and got
another error when trying to run the app:

"
Unhandled Exception: System.NullReferenceException: A null value was
found wher
 an object instance was required.
in (unmanaged) (wrapper managed-to-native)
SignalConnector:glade_xml_signal_aut
connect_full (intptr,Glade.XML/SignalConnector/RawXMLConnectFunc,intptr)
in <0x00004> (wrapper managed-to-native)
SignalConnector:glade_xml_signal_autoc
nnect_full (intptr,Glade.XML/SignalConnector/RawXMLConnectFunc,intptr)
in <0x0006b> SignalConnector:Autoconnect ()
in <0x00050> Glade.XML:Autoconnect (object)
in [0x0001f] (at
/home/invitro/Desktop/Kod/MD-projekt/TV-Guide/Main.cs:51) TVGu
de:.ctor (string[])
in [0x00001] (at
/home/invitro/Desktop/Kod/MD-projekt/TV-Guide/Main.cs:42) TVGu
de:Main (string[])
"

Worth mentioning might be that I'm not using the freshest version of
Mono/Gtk#, since I'm running Gentoo and want everything from portage.