summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-05-03 15:19:12 -0700
committerapache <apache@e5-web1.enlightenment.org>2018-05-03 15:19:12 -0700
commit70146f5b760e7557b7fe33b99ff3a26a0146150c (patch)
tree342281e81b3f344c2c01050779072f1a79e63e1c /pages
parenta86956cfa8e946ea58873b74c55f53943b27f121 (diff)
Wiki page csharp_tutorial changed with summary [Update example syntax after changes in master.] by Lauro Moura
Diffstat (limited to 'pages')
-rw-r--r--pages/develop/legacy/tutorial/csharp_tutorial.txt24
1 files changed, 12 insertions, 12 deletions
diff --git a/pages/develop/legacy/tutorial/csharp_tutorial.txt b/pages/develop/legacy/tutorial/csharp_tutorial.txt
index 4f9de8a76..170fd9888 100644
--- a/pages/develop/legacy/tutorial/csharp_tutorial.txt
+++ b/pages/develop/legacy/tutorial/csharp_tutorial.txt
@@ -67,7 +67,7 @@ Now that you can compile and install EFL with C# bindings lets see some code exa
67 67
68=== Button Example === 68=== Button Example ===
69 69
70Lets star with a very simple example that just creates a window with a button and show how to compile it. 70Lets start with a very simple example that just creates a window with a button and show how to compile it.
71After, the code will be explained. 71After, the code will be explained.
72 72
73<note tip> 73<note tip>
@@ -87,13 +87,13 @@ public class Example
87 { 87 {
88 efl.All.Init(efl.Components.Ui); 88 efl.All.Init(efl.Components.Ui);
89 89
90 efl.ui.Win win = new efl.ui.WinConcrete(null); 90 efl.ui.IWin win = new efl.ui.Win(null);
91 win.SetText("Hello, World!"); 91 win.SetText("Hello, World!");
92 win.SetAutohide(true); 92 win.SetAutohide(true);
93 win.SetSize(240, 60); 93 win.SetSize(240, 60);
94 win.SetVisible(true); 94 win.SetVisible(true);
95 95
96 efl.ui.Button btn = new efl.ui.ButtonConcrete(win); 96 efl.ui.IButton btn = new efl.ui.Button(win);
97 btn.SetText("Good-Bye, World!"); 97 btn.SetText("Good-Bye, World!");
98 btn.SetSize(120, 30); 98 btn.SetSize(120, 30);
99 eina.Position2D pos; 99 eina.Position2D pos;
@@ -101,7 +101,7 @@ public class Example
101 pos.Y = 15; 101 pos.Y = 15;
102 btn.SetPosition(pos); 102 btn.SetPosition(pos);
103 btn.SetVisible(true); 103 btn.SetVisible(true);
104 btn.CLICKED += (object sender, EventArgs e) => { 104 btn.ClickedEvt += (object sender, EventArgs e) => {
105 efl.ui.Config.Exit(); 105 efl.ui.Config.Exit();
106 }; 106 };
107 107
@@ -125,7 +125,7 @@ mcs button_example_00.cs -out:button_example_00.exe -r:/home/my_user/efl/build/s
125</code> 125</code>
126 126
127To run the application you can either copy the EFL C# binding library to your folder or set the ''MONO_PATH'' environment variable, them execute it using ''mono''. 127To run the application you can either copy the EFL C# binding library to your folder or set the ''MONO_PATH'' environment variable, them execute it using ''mono''.
128In both cases you can use ''pkg-config'' to get the right paths. 128In both cases, you can use ''pkg-config'' to get the right paths.
129 129
130Example coping the library: 130Example coping the library:
131<code bash> 131<code bash>
@@ -148,7 +148,7 @@ export LD_LIBRARY_PATH=/opt/my_install_prefix/lib
148 148
149== Explaining the code == 149== Explaining the code ==
150 150
151First we start with a basic class structure to define our ''Main'' entry point: 151First, we start with a basic class structure to define our ''Main'' entry point:
152<code csharp> 152<code csharp>
153using System; 153using System;
154 154
@@ -173,18 +173,18 @@ Then we initialize EFL with Ui components enabled:
173 efl.All.Init(efl.Components.Ui); 173 efl.All.Init(efl.Components.Ui);
174</code> 174</code>
175 175
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: 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:
177<code csharp> 177<code csharp>
178 efl.ui.Win win = new efl.ui.WinConcrete(null); 178 efl.ui.IWin win = new efl.ui.Win(null);
179 win.SetText("Hello, World!"); 179 win.SetText("Hello, World!");
180 win.SetAutohide(true); 180 win.SetAutohide(true);
181 win.SetSize(240, 60); 181 win.SetSize(240, 60);
182 win.SetVisible(true); 182 win.SetVisible(true);
183</code> 183</code>
184 184
185Create a new Button (passing the newly created window as parent), set new label text to the button, give it a dimension and position and turn it visible: 185Create a new Button (passing the newly created window as the parent), set new label text to the button, give it a dimension and position and turn it visible:
186<code csharp> 186<code csharp>
187 efl.ui.Button btn = new efl.ui.ButtonConcrete(win); 187 efl.ui.IButton btn = new efl.ui.Button(win);
188 btn.SetText("Good-Bye, World!"); 188 btn.SetText("Good-Bye, World!");
189 btn.SetSize(120, 30); 189 btn.SetSize(120, 30);
190 eina.Position2D pos; 190 eina.Position2D pos;
@@ -196,7 +196,7 @@ Create a new Button (passing the newly created window as parent), set new label
196 196
197And then register a function to the button ''CLICKED'' event: 197And then register a function to the button ''CLICKED'' event:
198<code csharp> 198<code csharp>
199 btn.CLICKED += (object sender, EventArgs e) => { 199 btn.ClickedEvt += (object sender, EventArgs e) => {
200 efl.ui.Config.Exit(); 200 efl.ui.Config.Exit();
201 }; 201 };
202</code> 202</code>
@@ -208,7 +208,7 @@ Once the setup is finished, we call:
208</code> 208</code>
209It starts the event loop and display the application main window. 209It starts the event loop and display the application main window.
210 210
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: 211After the event loop is finished (when closing the last window or by calling ''efl.ui.Config.Exit()'') we shut down the EFL components and let the application end:
212<code csharp> 212<code csharp>
213 efl.All.Shutdown(); 213 efl.All.Shutdown();
214</code> 214</code>