vitorsousa pushed a commit to branch master. http://git.enlightenment.org/tools/examples.git/commit/?id=006760cdf66c9585ddccedd12705f941147665f5
commit 006760cdf66c9585ddccedd12705f941147665f5 Author: Xavi Artigas <xavierarti...@yahoo.es> Date: Thu Aug 23 13:33:05 2018 -0300 C# Hello World tutorial Summary: This is the first C# tutorial: Hello World. It just creates a window. Reviewers: vitor.sousa, lauromoura Reviewed By: vitor.sousa Differential Revision: https://phab.enlightenment.org/D6900 --- tutorial/csharp/hello-world/meson.build | 10 +++++++++ tutorial/csharp/hello-world/src/hello-world.cs | 31 ++++++++++++++++++++++++++ tutorial/csharp/hello-world/src/meson.build | 12 ++++++++++ 3 files changed, 53 insertions(+) diff --git a/tutorial/csharp/hello-world/meson.build b/tutorial/csharp/hello-world/meson.build new file mode 100644 index 00000000..a1f9c37f --- /dev/null +++ b/tutorial/csharp/hello-world/meson.build @@ -0,0 +1,10 @@ +project( + 'efl-example-hello-world', 'cs', + version : '0.0.1', + meson_version : '>= 0.38.0') + +efl_mono = dependency('efl-mono', version : '>=1.20.99') +efl_mono_libs = efl_mono.get_pkgconfig_variable('mono_libs') + +subdir('src') + diff --git a/tutorial/csharp/hello-world/src/hello-world.cs b/tutorial/csharp/hello-world/src/hello-world.cs new file mode 100644 index 00000000..3ad4f210 --- /dev/null +++ b/tutorial/csharp/hello-world/src/hello-world.cs @@ -0,0 +1,31 @@ +using System; + +public class Example +{ +#if WIN32 + [STAThreadAttribute()] +#endif + public static void Main() + { + // Initialize EFL and all UI components + efl.All.Init(efl.Components.Ui); + + // Create a window and initialize it + efl.ui.IWin win = new efl.ui.Win(efl.App.GetLoopMain(), (efl.ui.IWin ewin) => { + // Set the window's title + ewin.SetText("Hello World"); + // Request that the window is automatically hidden when the "close" + // button is pressed + ewin.SetAutohide(true); + }); + // Window size must be explicitly set, otherwise it will be invisible + // due to its lack of content. + win.SetSize(new eina.Size2D(360, 240)); + + // Start the EFL main loop + efl.ui.Config.Run(); + + // Shutdown EFL + efl.All.Shutdown(); + } +} diff --git a/tutorial/csharp/hello-world/src/meson.build b/tutorial/csharp/hello-world/src/meson.build new file mode 100644 index 00000000..ddfa527f --- /dev/null +++ b/tutorial/csharp/hello-world/src/meson.build @@ -0,0 +1,12 @@ +src = files([ + 'hello-world.cs', +]) + +deps = [efl_mono] + +executable('efl_example_hello_world', src, + dependencies : deps, + cs_args : efl_mono_libs, + install : true +) + --