SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

gtk# exception

Last post 02-08-2007 1:00 PM by Gergely Kontra. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-08-2007 1:00 PM

    gtk# exception

    Hi!

    maybe not strongly sharpdevelop-related, but:


    I'm trying to create a simple glade project.

     The code is:

    using Glade;
    using Gtk;
    using System;

    public class GladeApp
    {   
        [Widget]
        Label messageLabel;
          
        public static void Main (string[] args)
        {
            new GladeApp (args);
        }

        public GladeApp (string[] args)
        {
            Application.Init();
            Glade.XML gxml = new Glade.XML(null, "csharpgtk.glade.xml", "mainWindow", null);
            gxml.Autoconnect(this);
            messageLabel.Text = "Hello, Gtk# World.";
            Application.Run();
        }
       
        void MainWindowDeleteEvent(object o, DeleteEventArgs args)
        {
            Application.Quit();
            args.RetVal = true;
        }
    }

     

    And I get an exception for the line autoconnect

    Exception System.InvalidCastException was thrown in debuggee:
    Unable to cast object of type 'Gtk.Label' to type 'GLib.Object'.xe

    CreateObject()
    GetObject()
    GetObject()
    GetWidget()
    BindFields()
    Autoconnect()
    .ctor() - d:\private\SharpDevelop Projects\csharpgtk\Main.cs:19,9
    Main() - d:\private\SharpDevelop Projects\csharpgtk\Main.cs:12,9

    What went wrong?

    gtk# version 2.8.3 Build 1

     

    thanks
     

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.