mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-09 01:25:46 +00:00
Get more done on packageserver
This commit is contained in:
18
Templates/gui/src/main.tcross
Normal file
18
Templates/gui/src/main.tcross
Normal file
@@ -0,0 +1,18 @@
|
||||
func btn1_Click(sender,e)
|
||||
{
|
||||
Console.WriteLine("Button Clicked");
|
||||
}
|
||||
func main(args)
|
||||
{
|
||||
if(TypeOf(GUI) != "Dictionary")
|
||||
{
|
||||
Console.WriteLine("The GUI is not supported, please build tessesframework with TESSESFRAMEWORK_ENABLE_SDL2.");
|
||||
return 1;
|
||||
}
|
||||
var window = GUI.Window.FromJSON(embed("layout.json"), SDL2.Window.Resizable);
|
||||
var btn1 = window.FindViewById("btn1");
|
||||
btn1.Click += btn1_Click;
|
||||
VM.RunEventLoop();
|
||||
btn.Click -= btn1_Click;
|
||||
window.Dispose(); //we need to destroy it or it will leak
|
||||
}
|
||||
Reference in New Issue
Block a user