using System; using Gtk; using Gecko; using System.Timers; public class MyWindow : Window { public static void Main (string[] args) { Application.Init (); new MyWindow (); Application.Run (); } WebControl browser = new WebControl (); Timer timer = new Timer (); public MyWindow () : base ("MyWindow") { this.Add (browser); this.SetDefaultSize (400, 300); this.DeleteEvent += new DeleteEventHandler (OnMyWindowDelete); this.ShowAll (); browser.LoadUrl ("www.sapo.pt"); timer.Elapsed += elapsed; timer.Interval = 5000; timer.Start (); } void OnMyWindowDelete (object sender, DeleteEventArgs a) { Application.Quit (); a.RetVal = true; } void elapsed (object sender, ElapsedEventArgs e) { Console.WriteLine ("1"); browser.LoadUrl ("www.restaunet.pt"); Console.WriteLine ("2"); } }