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
This commit is contained in:
parent
f6cc19575f
commit
006760cdf6
|
@ -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')
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue