• [^] # Re: manque le principal

    Posté par (site web personnel) . En réponse au message System.NullReferenceException avec Gecko. Évalué à 1.

    Sorry...

    // project created on 7/04/2005 at 11:49
    using System;
    using Gtk;
    using Glade;
    using Gecko;

    public class GBrowser
    {
    [Widget] Frame mainWindow;
    [Widget] Entry UrlEntry;
    WebControl web;

    public static void Main (string[] args)
    {
    new GBrowser (args);
    }

    public GBrowser (string[] args)
    {
    Application.Init();
    Glade.XML gxml = new Glade.XML (null, "gui.glade", "window1", null);
    gxml.Autoconnect (this);
    web = new WebControl();
    web.Show();
    mainWindow.Add(web);
    Application.Run();
    }

    /* Connect the Signals defined in Glade */
    public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
    {
    Application.Quit ();
    args.RetVal = true;
    }

    void load_url( object source, EventArgs args)
    {
    web.LoadUrl(UrlEntry.Text);
    }
    }