5 Oct 2004 rbultje   » (Master)

C#/Mono:
Since I like Java so much, I thought Mono deserved a fair chance, so I decided to write my own hello world in Mono, and didn't get too far. I was actually able to write my own Gnome.App and Gnome.Program subclasses and get myself a first window shown. Long live MonoDevelop, awesome tool. So then, I decided that the empty window was somewhat, well, empty, and that it needed menus.

Now, one hour later, I still don't know how to add menus. Muine, where I'm trying to learn from, appears to use glade, I would like to just use Gnome.UIInfo for this. So my first try:

    private void
    AddMenus ()
    {
      UIInfo[] file = {
        { null, null, "Quit", "Quit", null, UIInfoType.Item },
        { null, null, null, null, null, UIInfoType.Endofinfo }
      };
      UIInfo[] menus = {
        { null, null, "File", "File", null, UIInfoType.Subtree, file},
        { null, null, null, null, null, UIInfoType.Endofinfo }
      };
      
      CreateMenus (menus);
    }

Which gives me:

Constant value `null' cannot be converted to Gnome.UIInfo(CS0031)
Constant value `null' cannot be converted to Gnome.UIInfo(CS0031)
Use of unassigned local variable `menus'(CS0165)

Right. I would actually expect predefined members for Quit and File, but that's probably just me. Can anyone tell me how to add menus to a Gnome.App?

Update:
So I just copied the stuff from the GnomeHelloWorld.cs in mono CVS. Next problem: the anonymous CVS server of Mono.

[rbultje@tux GStreamer]$ cvs -d:pserver:anonymous@anoncvs-spain-1.go-mono.com:/mono co gst-sharp
can't create temporary directory /tmp/cvs-serv21785
No space left on device
[rbultje@tux GStreamer]$ cvs -d:pserver:anonymous@anoncvs-spain-2.go-mono.com:/mono login
Logging in to :pserver:anonymous@anoncvs-spain-2.go-mono.com:2401/mono
CVS password:
Unknown host anoncvs-spain-2.go-mono.com.
[rbultje@tux GStreamer]$ cvs -d:pserver:anonymous@us-anoncvs.go-mono.com:/mono login
Logging in to :pserver:anonymous@us-anoncvs.go-mono.com:2401/mono
CVS password:
Unknown host us-anoncvs.go-mono.com.
[rbultje@tux GStreamer]$ cvs -d:pserver:anonymous@anoncvs.go-mono.com:/mono co gst-sharp
can't create temporary directory /tmp/cvs-serv19708
No space left on device

Now what do I do?

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!