Skip to content

Instantly share code, notes, and snippets.

@mikicho
Last active August 29, 2015 14:21
Show Gist options
  • Save mikicho/18847bd80a154ab36c1b to your computer and use it in GitHub Desktop.
Save mikicho/18847bd80a154ab36c1b to your computer and use it in GitHub Desktop.
#pragma warning disable 109, 114, 219, 429, 168, 162
public class EntryPoint__Main {
public static void Main() {
global::cs.Boot.init();
global::Main.main();
}
}
public class Main {
public Main() {
}
public static void main() {
global::System.Windows.Forms.Application.EnableVisualStyles();
global::System.Windows.Forms.Application.Run(((global::System.Windows.Forms.Form) (new global::AppForm()) ));
}
}
#pragma warning disable 109, 114, 219, 429, 168, 162
public class AppForm : global::System.Windows.Forms.Form {
public AppForm() : base() {
global::System.Windows.Forms.Button btn = new global::System.Windows.Forms.Button();
( this as global::System.Windows.Forms.Control ).Controls.Add(((global::System.Windows.Forms.Control) (btn) ));
( btn as global::System.Windows.Forms.Control ).Text = ((string) ("Press me!") );
{
global::System.EventHandler arg2 = null;
{
global::System.EventHandler this1 = null;
this1 = ((global::System.EventHandler) (this.clickHandler) );
arg2 = ((global::System.EventHandler) (this1) );
}
btn.Click = ( btn.Click + arg2 );
}
}
public virtual void clickHandler(object sender, global::System.EventArgs e) {
unchecked {
global::haxe.Log.trace.__hx_invoke2_o(default(double), "Thank you!", default(double), new global::haxe.lang.DynamicObject(new int[]{302979532, 1547539107, 1648581351}, new object[]{"clickHandler", "AppForm", "Main.hx"}, new int[]{1981972957}, new double[]{((double) (34) )}));
}
}
}
package;
import cs.system.windows.forms.Application;
import cs.system.windows.forms.Form;
import cs.system.EventHandler;
/**
* ...
* @author Michael
*/
@:nativeGen class Main
{
static function main()
{
Application.EnableVisualStyles();
Application.Run(new AppForm());
}
}
@:nativeGen class AppForm extends Form {
public function new() {
super();
var btn = new cs.system.windows.forms.Button();
this.Controls.Add(btn);
btn.Text = 'Press me!';
btn.Click += new EventHandler(clickHandler);
}
function clickHandler(sender:Dynamic, e:cs.system.EventArgs):Void {
trace('Thank you!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment