2018-08-23 09:33:05 -07:00
|
|
|
using System;
|
|
|
|
|
2019-03-26 04:19:13 -07:00
|
|
|
public class Example : Efl.Csharp.Application
|
2018-08-23 09:33:05 -07:00
|
|
|
{
|
2019-09-12 06:01:45 -07:00
|
|
|
// Callback to quit the application
|
|
|
|
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
|
|
|
|
{
|
|
|
|
// Exit the EFL main loop
|
2020-02-07 00:49:57 -08:00
|
|
|
if (e.Arg == false)
|
2019-09-12 06:01:45 -07:00
|
|
|
Efl.App.AppMain.Quit(0);
|
|
|
|
}
|
|
|
|
|
2019-06-28 15:46:12 -07:00
|
|
|
protected override void OnInitialize(string[] args)
|
2018-08-23 09:33:05 -07:00
|
|
|
{
|
|
|
|
// Create a window and initialize it
|
2019-01-18 07:53:55 -08:00
|
|
|
Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain);
|
|
|
|
// Set the window's title
|
2020-02-20 08:09:22 -08:00
|
|
|
win.Text = "Hello World";
|
2019-01-18 07:53:55 -08:00
|
|
|
// Request that the window is automatically hidden when the "close"
|
|
|
|
// button is pressed
|
2020-02-20 08:09:22 -08:00
|
|
|
win.Autohide = true;
|
2018-08-23 09:33:05 -07:00
|
|
|
// Window size must be explicitly set, otherwise it will be invisible
|
|
|
|
// due to its lack of content.
|
2020-02-20 08:09:22 -08:00
|
|
|
win.Size = new Eina.Size2D(360, 240);
|
2019-09-12 06:01:45 -07:00
|
|
|
win.VisibilityChangedEvent += QuitCb;
|
2019-03-26 04:19:13 -07:00
|
|
|
}
|
2018-08-23 09:33:05 -07:00
|
|
|
|
2019-03-26 04:19:13 -07:00
|
|
|
#if WIN32
|
|
|
|
[STAThreadAttribute()]
|
|
|
|
#endif
|
|
|
|
public static void Main()
|
|
|
|
{
|
|
|
|
var example = new Example();
|
|
|
|
example.Launch();
|
2018-08-23 09:33:05 -07:00
|
|
|
}
|
|
|
|
}
|