diff options
Diffstat (limited to 'tutorial/csharp/hello-gui/src/gui_main.cs')
-rw-r--r-- | tutorial/csharp/hello-gui/src/gui_main.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tutorial/csharp/hello-gui/src/gui_main.cs b/tutorial/csharp/hello-gui/src/gui_main.cs index 8a30430..2f50745 100644 --- a/tutorial/csharp/hello-gui/src/gui_main.cs +++ b/tutorial/csharp/hello-gui/src/gui_main.cs | |||
@@ -3,10 +3,11 @@ using System; | |||
3 | public class Example | 3 | public class Example |
4 | { | 4 | { |
5 | // Callback to quit the application | 5 | // Callback to quit the application |
6 | public static void QuitCb(object sender, EventArgs e) | 6 | public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEvt_Args e) |
7 | { | 7 | { |
8 | // Exit the EFL main loop | 8 | // Exit the EFL main loop |
9 | Efl.Ui.Config.Exit(); | 9 | if (e.arg == false) |
10 | Efl.Ui.Config.Exit(); | ||
10 | } | 11 | } |
11 | 12 | ||
12 | #if WIN32 | 13 | #if WIN32 |
@@ -25,12 +26,12 @@ public class Example | |||
25 | // button is pressed | 26 | // button is pressed |
26 | win.SetAutohide(true); | 27 | win.SetAutohide(true); |
27 | // Hook to the Hide event | 28 | // Hook to the Hide event |
28 | win.HideEvt += QuitCb; | 29 | win.VisibilityChangedEvt += QuitCb; |
29 | 30 | ||
30 | // Create a box container | 31 | // Create a box container |
31 | var box = new Efl.Ui.Box(win); | 32 | var box = new Efl.Ui.Box(win); |
32 | // Set its minimum size | 33 | // Set its minimum size |
33 | box.SetHintMin(new Eina.Size2D(360, 240)); | 34 | box.SetHintSizeMin(new Eina.Size2D(360, 540)); |
34 | // Set the box as the content for the window | 35 | // Set the box as the content for the window |
35 | // The window size will adapt to the box size | 36 | // The window size will adapt to the box size |
36 | win.SetContent(box); | 37 | win.SetContent(box); |
@@ -51,7 +52,7 @@ public class Example | |||
51 | button.SetText("Quit"); | 52 | button.SetText("Quit"); |
52 | button.SetHintWeight(1.0, 0.1); | 53 | button.SetHintWeight(1.0, 0.1); |
53 | // Set the method to be called when the button is pressed | 54 | // Set the method to be called when the button is pressed |
54 | button.ClickedEvt += QuitCb; | 55 | button.ClickedEvt += (object sender, EventArgs e) => { Efl.Ui.Config.Exit(); }; |
55 | // Add the button to the box container | 56 | // Add the button to the box container |
56 | box.DoPack(button); | 57 | box.DoPack(button); |
57 | 58 | ||