summaryrefslogtreecommitdiff
path: root/apps/csharp/texteditor/src/texteditor_main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/csharp/texteditor/src/texteditor_main.cs')
-rw-r--r--apps/csharp/texteditor/src/texteditor_main.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/csharp/texteditor/src/texteditor_main.cs b/apps/csharp/texteditor/src/texteditor_main.cs
index 9793a5b..f697245 100644
--- a/apps/csharp/texteditor/src/texteditor_main.cs
+++ b/apps/csharp/texteditor/src/texteditor_main.cs
@@ -32,9 +32,10 @@ public class TextEditor
32 "texteditor_example.txt"); 32 "texteditor_example.txt");
33 33
34 // Quits the application 34 // Quits the application
35 private void GUIQuitCb(object sender, EventArgs ea) 35 private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEvt_Args ea)
36 { 36 {
37 Efl.Ui.Config.Exit(); 37 if (ea.arg == false)
38 Efl.Ui.Config.Exit();
38 } 39 }
39 40
40 // Enables or disables buttons on the toolbar as required 41 // Enables or disables buttons on the toolbar as required
@@ -146,7 +147,7 @@ public class TextEditor
146 bar.DoPack(box); 147 bar.DoPack(box);
147 148
148 // "Quit" button 149 // "Quit" button
149 GUIToolbarButtonAdd(bar, "Quit", "application-exit", GUIQuitCb); 150 GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, EventArgs e) => { Efl.Ui.Config.Exit(); } );
150 } 151 }
151 152
152 // Builds the user interface for the text editor 153 // Builds the user interface for the text editor
@@ -156,7 +157,7 @@ public class TextEditor
156 win = new Efl.Ui.Win(parent: Efl.App.AppMain); 157 win = new Efl.Ui.Win(parent: Efl.App.AppMain);
157 win.SetText("Text Editor"); 158 win.SetText("Text Editor");
158 win.SetAutohide(true); 159 win.SetAutohide(true);
159 win.HideEvt += GUIQuitCb; 160 win.VisibilityChangedEvt += GUIQuitCb;
160 161
161 // Create a vertical box container 162 // Create a vertical box container
162 Efl.Ui.Box box = new Efl.Ui.Box(win); 163 Efl.Ui.Box box = new Efl.Ui.Box(win);
@@ -168,10 +169,10 @@ public class TextEditor
168 // Create the main text entry 169 // Create the main text entry
169 editorTextBox = new Efl.Ui.Text(box); 170 editorTextBox = new Efl.Ui.Text(box);
170 editorTextBox.SetFont("Mono", 14); 171 editorTextBox.SetFont("Mono", 14);
171 editorTextBox.SetMultiline(true); 172 editorTextBox.Multiline = true;
172 editorTextBox.SetEditable(true); 173 editorTextBox.Editable = true;
173 editorTextBox.SetScrollable(true); 174 editorTextBox.Scrollable = true;
174 editorTextBox.SetHintMin(new Eina.Size2D(360, 240)); 175 editorTextBox.SetHintSizeMin(new Eina.Size2D(360, 240));
175 editorTextBox.ChangedEvt += EditorChangedCb; 176 editorTextBox.ChangedEvt += EditorChangedCb;
176 editorTextBox.ChangedUserEvt += EditorChangedCb; 177 editorTextBox.ChangedUserEvt += EditorChangedCb;
177 box.DoPack(editorTextBox); 178 box.DoPack(editorTextBox);