Skip to content

Instantly share code, notes, and snippets.

@slothbag
Created March 27, 2015 03:04
Show Gist options
  • Save slothbag/5b802f34fa3df5fbd9a5 to your computer and use it in GitHub Desktop.
Save slothbag/5b802f34fa3df5fbd9a5 to your computer and use it in GitHub Desktop.
Example app display issue 303
using System;
using Eto.Forms;
using Eto.Drawing;
/* APP REFERENCES
* Eto
* Eto.Gtk2
* System
*/
class MyForm : Eto.Forms.Form
{
public MyForm()
{
this.ClientSize = new Eto.Drawing.Size(600, 400);
this.Title = "Hello, Eto.Forms";
WebView wv = new WebView();
wv.OpenNewWindow += e_OnNewWindow;
var layout = new DynamicLayout();
layout.Padding = new Padding(0);
layout.BeginHorizontal();
layout.Add(wv, xscale: true);
layout.EndHorizontal();
Content = layout;
wv.LoadHtml("<html><body><a href=\"http://www.google.com\" target=\"_blank\">blank</a></body></html>");
}
static void e_OnNewWindow(object sender, object e) {
Console.WriteLine("App will crash on return from this method");
return;
}
}
class Startup
{
[STAThread]
public static void Main(string[] args)
{
new Eto.Forms.Application().Run(new MyForm());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment