WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=3138388fff1b9b3f7a203e5db121adf37d4323fe
commit 3138388fff1b9b3f7a203e5db121adf37d4323fe Author: Vitor Sousa da Silva <vitorsousasi...@gmail.com> Date: Mon Feb 5 08:02:07 2018 -0800 Wiki page csharp_tutorial changed with summary [] by Vitor Sousa da Silva --- pages/develop/legacy/tutorial/csharp_tutorial.txt | 39 +++++++++++++---------- 1 file 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 @@ ~~Title: C# Tutorial~~ ===== C# Tutorial ===== +This tutorial shows how to compile and install the Enlightenment Foundation Libraries (EFL) with C# bindings support, and some examples of how to use it. + <note important> The C# bindings are currently in BETA state. </note> @@ -15,19 +17,19 @@ Before you start you may want to read about how to compile the EFL: === Dependencies === -== Linux == +== On Linux == -You will need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). +You need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). The paths to the ''mcs'' compiler and to the ''mono'' application must be in the ''PATH'' environment variable before compiling. Once all conditions are met proceed to [[#Compilation]]. -== Windows == +== On Windows == -In 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]]. +In 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]]. -You will need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). -You 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. +You need a compatible version of [[http://www.mono-project.com|Mono]] (4.0 or higher). +You 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. Using 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''. You can also permanently set this in your ''/etc/profile'' in MSYS2 adding something like this at the end of the file: <code bash> @@ -35,7 +37,7 @@ export PATH="$PATH:/c/Program Files/Mono/bin" </code> If you used another installation path to Mono just adjust the paths used. -<note warning> +<note important> It is advisable to add the Mono path at the *end* of the ''PATH'' environment variable, like in the example above. Mono has its own version of some applications (like ''pkg-config'') which can take priority over the ones from MSYS2 and cause things to fail. </note> @@ -43,9 +45,9 @@ Mono has its own version of some applications (like ''pkg-config'') which can ta Now you can use the MSYS2 console to compile, install and run EFL and your applications. Once all conditions are met proceed to [[#Compilation]]. -=== Compilation === +=== Compiling and Installing === -In 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. +In 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. Like: <code bash> ./autogen.sh --enable-csharp-bindings #other arguments @@ -53,15 +55,20 @@ make -j4 sudo make install </code> +<note> +It 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. +Normally reading the error message and installing the missing package solves the problem. +If you can not solve the problem by yourself, try [[/contact|contacting]] the community. +</note> ==== Examples ==== -Now that you can compile and install EFL with the C# bindings lets see some code examples. +Now that you can compile and install EFL with C# bindings lets see some code examples. === Button Example === Lets star with a very simple example that just creates a window with a button and show how to compile it. -After we will explain the code. +After, the code will be explained. <note tip> You 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 mcs button_example_00.cs -out:button_example_00.exe `pkg-config --libs efl-mono` </code> -Otherwise, you will have to point the library location manually, like: +Otherwise, you have to point the library location manually, like: <code bash> mcs button_example_00.cs -out:button_example_00.exe -r:/home/my_user/efl/build/src/lib/efl_mono/libefl_mono.dll </code> @@ -132,8 +139,8 @@ export MONO_PATH=`pkg-config --variable=assemblies_dir efl-mono` mono button_example_00.exe </code> -Note 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, -for example setting proper environment variables: +Note 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, +for example setting proper environment variables before compiling and running: <code bash> export PKG_CONFIG_PATH=/opt/my_install_prefix/lib/pkgconfig export LD_LIBRARY_PATH=/opt/my_install_prefix/lib @@ -166,7 +173,7 @@ Then we initialize EFL with Ui components enabled: efl.All.Init(efl.Components.Ui); </code> -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: +And 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: <code csharp> efl.ui.Win win = new efl.ui.WinConcrete(null); win.SetText("Hello, World!"); @@ -199,7 +206,7 @@ Once the setup is finished, we call: <code csharp> efl.ui.Config.Run(); </code> -It will start the event loop and display the application main window. +It starts the event loop and display the application main window. After 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: <code csharp> --