summaryrefslogtreecommitdiff
path: root/pages/develop/legacy/tutorial
diff options
context:
space:
mode:
authorVitor Sousa da Silva <vitorsousasilva@gmail.com>2018-02-05 08:02:07 -0800
committerapache <apache@e5-web1.enlightenment.org>2018-02-05 08:02:07 -0800
commit3138388fff1b9b3f7a203e5db121adf37d4323fe (patch)
tree9916be7e8ce7f2e83aa71b505b30b407ba65c700 /pages/develop/legacy/tutorial
parent648ed87cc77448db82944af7053ce9320963cd31 (diff)
Wiki page csharp_tutorial changed with summary [] by Vitor Sousa da Silva
Diffstat (limited to 'pages/develop/legacy/tutorial')
-rw-r--r--pages/develop/legacy/tutorial/csharp_tutorial.txt39
1 files changed, 23 insertions, 16 deletions
diff --git a/pages/develop/legacy/tutorial/csharp_tutorial.txt b/pages/develop/legacy/tutorial/csharp_tutorial.txt
index 9dcd9d9fb..80eb9c39a 100644
--- a/pages/develop/legacy/tutorial/csharp_tutorial.txt
+++ b/pages/develop/legacy/tutorial/csharp_tutorial.txt
@@ -1,6 +1,8 @@
1~~Title: C# Tutorial~~ 1~~Title: C# Tutorial~~
2===== C# Tutorial ===== 2===== C# Tutorial =====
3 3
4This tutorial shows how to compile and install the Enlightenment Foundation Libraries (EFL) with C# bindings support, and some examples of how to use it.
5
4<note important> 6<note important>
5The C# bindings are currently in BETA state. 7The C# bindings are currently in BETA state.
6</note> 8</note>
@@ -15,19 +17,19 @@ Before you start you may want to read about how to compile the EFL:
15 17
16=== Dependencies === 18=== Dependencies ===
17 19
18== Linux == 20== On Linux ==
19 21
20You will need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). 22You need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher).
21The paths to the ''mcs'' compiler and to the ''mono'' application must be in the ''PATH'' environment variable before compiling. 23The paths to the ''mcs'' compiler and to the ''mono'' application must be in the ''PATH'' environment variable before compiling.
22 24
23Once all conditions are met proceed to [[#Compilation]]. 25Once all conditions are met proceed to [[#Compilation]].
24 26
25== Windows == 27== On Windows ==
26 28
27In order to have EFL on a Windows environment we highly recommend following [[https://phab.enlightenment.org/w/windows/|this guide]] which accomplishes that using [[win-builds.org|win-builds]] and [[http://www.msys2.org/|MSYS2]]. 29In order to have EFL on a Windows environment we highly recommend following [[https://phab.enlightenment.org/w/windows/|this guide]] which accomplishes that using [[http://win-builds.org|win-builds]] and [[http://www.msys2.org/|MSYS2]].
28 30
29You will need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). 31You need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher).
30You can use Mono binaries installed directly to your Windows system (i.e. outside the MSYS2 environment), you will just need to make sure that the paths to the ''mcs.exe'' compiler and to the ''mono.exe'' application are in the ''PATH'' environment variable in your MSYS2 terminal. 32You can use Mono binaries installed directly to your Windows system (i.e. outside the MSYS2 environment), you just need to make sure that the paths to the ''mcs.exe'' compiler and to the ''mono.exe'' application are in the ''PATH'' environment variable in your MSYS2 terminal.
31Using the default installation path, Mono binaries normally goes in ''C:\Program Files\Mono''; so in MSYS2 you can point to the binaries using the path ''/c/Program Files/Mono/bin''. 33Using the default installation path, Mono binaries normally goes in ''C:\Program Files\Mono''; so in MSYS2 you can point to the binaries using the path ''/c/Program Files/Mono/bin''.
32You can also permanently set this in your ''/etc/profile'' in MSYS2 adding something like this at the end of the file: 34You can also permanently set this in your ''/etc/profile'' in MSYS2 adding something like this at the end of the file:
33<code bash> 35<code bash>
@@ -35,7 +37,7 @@ export PATH="$PATH:/c/Program Files/Mono/bin"
35</code> 37</code>
36If you used another installation path to Mono just adjust the paths used. 38If you used another installation path to Mono just adjust the paths used.
37 39
38<note warning> 40<note important>
39It is advisable to add the Mono path at the *end* of the ''PATH'' environment variable, like in the example above. 41It is advisable to add the Mono path at the *end* of the ''PATH'' environment variable, like in the example above.
40Mono has its own version of some applications (like ''pkg-config'') which can take priority over the ones from MSYS2 and cause things to fail. 42Mono has its own version of some applications (like ''pkg-config'') which can take priority over the ones from MSYS2 and cause things to fail.
41</note> 43</note>
@@ -43,9 +45,9 @@ Mono has its own version of some applications (like ''pkg-config'') which can ta
43Now you can use the MSYS2 console to compile, install and run EFL and your applications. 45Now you can use the MSYS2 console to compile, install and run EFL and your applications.
44Once all conditions are met proceed to [[#Compilation]]. 46Once all conditions are met proceed to [[#Compilation]].
45 47
46=== Compilation === 48=== Compiling and Installing ===
47 49
48In order to compile EFL with C# binding support, in both Windows and Linux just compile the EFL like the respective guide suggests, only add the argument ''--enable-csharp-bindings'' to the ''autogen.sh'' or ''configure'' command. 50In order to compile and install EFL with C# binding support, in both Windows and Linux just compile the EFL like the respective guide suggests, only add the argument ''--enable-csharp-bindings'' to the ''autogen.sh'' or ''configure'' command.
49Like: 51Like:
50<code bash> 52<code bash>
51./autogen.sh --enable-csharp-bindings #other arguments 53./autogen.sh --enable-csharp-bindings #other arguments
@@ -53,15 +55,20 @@ make -j4
53sudo make install 55sudo make install
54</code> 56</code>
55 57
58<note>
59It is known that some tutorials can get a bit outdated from time to time, causing the building process to fail, usually because of a missing dependency.
60Normally reading the error message and installing the missing package solves the problem.
61If you can not solve the problem by yourself, try [[/contact|contacting]] the community.
62</note>
56 63
57==== Examples ==== 64==== Examples ====
58 65
59Now that you can compile and install EFL with the C# bindings lets see some code examples. 66Now that you can compile and install EFL with C# bindings lets see some code examples.
60 67
61=== Button Example === 68=== Button Example ===
62 69
63Lets star with a very simple example that just creates a window with a button and show how to compile it. 70Lets star with a very simple example that just creates a window with a button and show how to compile it.
64After we will explain the code. 71After, the code will be explained.
65 72
66<note tip> 73<note tip>
67You can find this example in ''<efl_source>/src/examples/elementary/button_example_00.cs'' 74You can find this example in ''<efl_source>/src/examples/elementary/button_example_00.cs''
@@ -112,7 +119,7 @@ If you have EFL installed you can compile the example using ''pkg-config'' to ge
112mcs button_example_00.cs -out:button_example_00.exe `pkg-config --libs efl-mono` 119mcs button_example_00.cs -out:button_example_00.exe `pkg-config --libs efl-mono`
113</code> 120</code>
114 121
115Otherwise, you will have to point the library location manually, like: 122Otherwise, you have to point the library location manually, like:
116<code bash> 123<code bash>
117mcs button_example_00.cs -out:button_example_00.exe -r:/home/my_user/efl/build/src/lib/efl_mono/libefl_mono.dll 124mcs button_example_00.cs -out:button_example_00.exe -r:/home/my_user/efl/build/src/lib/efl_mono/libefl_mono.dll
118</code> 125</code>
@@ -132,8 +139,8 @@ export MONO_PATH=`pkg-config --variable=assemblies_dir efl-mono`
132mono button_example_00.exe 139mono button_example_00.exe
133</code> 140</code>
134 141
135Note that if you installed EFL in a path that is not directly accessible to ''pkg-config'' or to your application you will have to manually make it accessible someway, 142Note that if you installed EFL in a path that is not directly accessible to ''pkg-config'' or to your application you have to manually make it accessible someway,
136for example setting proper environment variables: 143for example setting proper environment variables before compiling and running:
137<code bash> 144<code bash>
138export PKG_CONFIG_PATH=/opt/my_install_prefix/lib/pkgconfig 145export PKG_CONFIG_PATH=/opt/my_install_prefix/lib/pkgconfig
139export LD_LIBRARY_PATH=/opt/my_install_prefix/lib 146export LD_LIBRARY_PATH=/opt/my_install_prefix/lib
@@ -166,7 +173,7 @@ Then we initialize EFL with Ui components enabled:
166 efl.All.Init(efl.Components.Ui); 173 efl.All.Init(efl.Components.Ui);
167</code> 174</code>
168 175
169Create a new Window with auto hide (the window is automatically hidden when the close button is clicked), set its title, give it a dimension and turn it visible: 176And create a new Window with auto hide (the window is automatically hidden when the close button is clicked), set its title, give it a dimension and turn it visible:
170<code csharp> 177<code csharp>
171 efl.ui.Win win = new efl.ui.WinConcrete(null); 178 efl.ui.Win win = new efl.ui.WinConcrete(null);
172 win.SetText("Hello, World!"); 179 win.SetText("Hello, World!");
@@ -199,7 +206,7 @@ Once the setup is finished, we call:
199<code csharp> 206<code csharp>
200 efl.ui.Config.Run(); 207 efl.ui.Config.Run();
201</code> 208</code>
202It will start the event loop and display the application main window. 209It starts the event loop and display the application main window.
203 210
204After the event loop is finished (when closing the last window or by calling ''efl.ui.Config.Exit()'') we shutdown the EFL components and let the application end: 211After the event loop is finished (when closing the last window or by calling ''efl.ui.Config.Exit()'') we shutdown the EFL components and let the application end:
205<code csharp> 212<code csharp>