summaryrefslogtreecommitdiff
path: root/reference/csharp/ui/src/ui_sizing.cs
diff options
context:
space:
mode:
Diffstat (limited to 'reference/csharp/ui/src/ui_sizing.cs')
-rw-r--r--reference/csharp/ui/src/ui_sizing.cs47
1 files changed, 21 insertions, 26 deletions
diff --git a/reference/csharp/ui/src/ui_sizing.cs b/reference/csharp/ui/src/ui_sizing.cs
index dd6e5ff..ac25283 100644
--- a/reference/csharp/ui/src/ui_sizing.cs
+++ b/reference/csharp/ui/src/ui_sizing.cs
@@ -19,40 +19,35 @@ public class Example
19 Efl.All.Init(Efl.Components.Ui); 19 Efl.All.Init(Efl.Components.Ui);
20 20
21 // Create a window and initialize it 21 // Create a window and initialize it
22 Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => { 22 Efl.Ui.Win win = new Efl.Ui.Win(null);
23 ewin.SetWinType(Efl.Ui.WinType.Basic); 23 win.SetWinType(Efl.Ui.WinType.Basic);
24 ewin.SetText("Size Control"); 24 win.SetText("Size Control");
25 ewin.SetAutohide(true); 25 win.SetAutohide(true);
26 ewin.HideEvt += (object sender, EventArgs e) => { 26 win.HideEvt += (object sender, EventArgs e) => {
27 // Exit the EFL main loop 27 // Exit the EFL main loop
28 Efl.Ui.Config.Exit(); 28 Efl.Ui.Config.Exit();
29 }; 29 };
30 });
31 30
32 // Create a box container 31 // Create a box container
33 Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => { 32 Efl.Ui.Box box = new Efl.Ui.Box(win);
34 win.SetContent(ebox); 33 win.SetContent(box);
35 });
36 34
37 // Create a regular button (without size hints) 35 // Create a regular button (without size hints)
38 new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => { 36 var button = new Efl.Ui.Button(win);
39 ebutton.SetText("Button"); 37 button.SetText("Button");
40 box.DoPack(ebutton); 38 box.DoPack(button);
41 });
42 39
43 // Create a small button (max size is limited) 40 // Create a small button (max size is limited)
44 new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => { 41 button = new Efl.Ui.Button(win);
45 ebutton.SetText("Small"); 42 button.SetText("Small");
46 ebutton.SetHintMax(new Eina.Size2D(50,50)); 43 button.SetHintMax(new Eina.Size2D(50,50));
47 box.DoPack(ebutton); 44 box.DoPack(button);
48 });
49 45
50 // Create a big button (min size is limited) 46 // Create a big button (min size is limited)
51 new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => { 47 button = new Efl.Ui.Button(win);
52 ebutton.SetText("Big button"); 48 button.SetText("Big button");
53 ebutton.SetHintMin(new Eina.Size2D(100,100)); 49 button.SetHintMin(new Eina.Size2D(100,100));
54 box.DoPack(ebutton); 50 box.DoPack(button);
55 });
56 51
57 // Start the EFL main loop 52 // Start the EFL main loop
58 Efl.Ui.Config.Run(); 53 Efl.Ui.Config.Run();