mono-examples: Adapt to latest syntax

Summary:
Removed initializer methods as much as possible to prepare
for when they are removed from the C# bindings.
No functional changes in the examples.
Tutorial text needs to be adapted now.

Test Plan: All examples work as before (the containers one is currently broken, FML).

Reviewers: lauromoura, felipealmeida, vitor.sousa

Reviewed By: lauromoura

Maniphest Tasks: T7508

Differential Revision: https://phab.enlightenment.org/D7695
devs/lauromoura/csharp_constructors
Xavi Artigas 4 years ago
parent e674ff0d97
commit 500049f1eb
  1. 9
      apps/csharp/life/src/life_main.cs
  2. 88
      apps/csharp/texteditor/src/texteditor_main.cs
  3. 48
      reference/csharp/core/src/core_event.cs
  4. 10
      reference/csharp/core/src/core_idler.cs
  5. 10
      reference/csharp/core/src/core_poll.cs
  6. 69
      reference/csharp/ui/src/focus_main.cs
  7. 90
      reference/csharp/ui/src/ui_container.cs
  8. 47
      reference/csharp/ui/src/ui_sizing.cs
  9. 15
      tutorial/csharp/eo-intro/src/eo_intro_main.cs
  10. 64
      tutorial/csharp/hello-gui/src/gui_main.cs
  11. 13
      tutorial/csharp/hello-world/src/hello-world.cs

@ -37,11 +37,10 @@ public class LifeWindow
public LifeWindow()
{
Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("EFL Life");
ewin.SetAutohide(true);
});
Efl.Ui.Win win = new Efl.Ui.Win(null);
win.SetWinType(Efl.Ui.WinType.Basic);
win.SetText("EFL Life");
win.SetAutohide(true);
// when the user clicks "close" on a window there is a request to hide
((Efl.Gfx.Entity)win).HideEvt += QuitEvt;

@ -58,50 +58,46 @@ public class TextEditor
// Shows a modal message popup with an "OK" button
private void ShowMessage(string message)
{
new Efl.Ui.TextAlertPopup (win, (Efl.Ui.TextAlertPopup epopup) => {
epopup.SetText(message);
epopup.SetExpandable(new Eina.Size2D(200,200));
epopup.SetButton(Efl.Ui.AlertPopupButton.Positive, "OK", null);
epopup.ButtonClickedEvt +=
(object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args ea) => {
// Dismiss popup when the button is clicked
((Efl.Ui.TextAlertPopup)sender).SetParent(null);
};
});
var popup = new Efl.Ui.TextAlertPopup (win);
popup.SetText(message);
popup.SetExpandable(new Eina.Size2D(200, 200));
popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "OK", null);
popup.ButtonClickedEvt +=
(object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args ea) => {
// Dismiss popup when the button is clicked
((Efl.Ui.TextAlertPopup)sender).SetParent(null);
};
}
// Adds a button to the toolbar, with the given text, icon and click event handler
private Efl.Ui.Button GUIToolbarButtonAdd(Efl.Ui.Box toolbar, string name,
string iconName, EventHandler func)
{
return new Efl.Ui.Button(toolbar, (Efl.Ui.Button ebutton) => {
ebutton.SetText(name);
ebutton.ClickedEvt += func;
ebutton.SetHintWeight(0, 1);
toolbar.DoPack(ebutton);
// Set the content of the button
ebutton.SetContent(
// Which is an image
new Efl.Ui.Image(toolbar, (Efl.Ui.Image eimage) => {
eimage.SetIcon(iconName);
})
);
});
var button = new Efl.Ui.Button(toolbar);
button.SetText(name);
button.ClickedEvt += func;
button.SetHintWeight(0, 1);
// Set the content of the button, which is an image
var image = new Efl.Ui.Image(toolbar);
image.SetIcon(iconName);
button.SetContent(image);
toolbar.DoPack(button);
return button;
}
// Creates a new toolbar, with all its buttons
private void GUIToolbarSetup(Efl.Ui.Box parent)
{
// Create a horizontal box container for the buttons
Efl.Ui.Box bar = new Efl.Ui.Box(parent, (Efl.Ui.Box ebox) => {
// 0 vertical weight means that the toolbar will have the minimum height
// to accommodate all its buttons and not a pixel more. The rest of the
// space will be given to the other object in the parent container.
ebox.SetHintWeight(1, 0);
ebox.SetDirection(Efl.Ui.Dir.Horizontal);
parent.DoPack(ebox);
});
var bar = new Efl.Ui.Box(parent);
// 0 vertical weight means that the toolbar will have the minimum height
// to accommodate all its buttons and not a pixel more. The rest of the
// space will be given to the other object in the parent container.
bar.SetHintWeight(1, 0);
bar.SetDirection(Efl.Ui.Dir.Horizontal);
parent.DoPack(bar);
// "New" button
toolbarButtonNew = GUIToolbarButtonAdd(bar, "New", "document-new",
@ -157,11 +153,10 @@ public class TextEditor
public TextEditor()
{
// Create a window and initialize it
win = new Efl.Ui.Win(Efl.App.AppMain, (Efl.Ui.Win ewin) => {
ewin.SetText("Text Editor");
ewin.SetAutohide(true);
ewin.HideEvt += GUIQuitCb;
});
win = new Efl.Ui.Win(Efl.App.AppMain);
win.SetText("Text Editor");
win.SetAutohide(true);
win.HideEvt += GUIQuitCb;
// Create a vertical box container
Efl.Ui.Box box = new Efl.Ui.Box(win);
@ -171,16 +166,15 @@ public class TextEditor
GUIToolbarSetup(box);
// Create the main text entry
editorTextBox = new Efl.Ui.Text(box, (Efl.Ui.Text etext) => {
etext.SetFont("Mono", 14);
etext.SetMultiline(true);
etext.SetEditable(true);
etext.SetScrollable(true);
etext.SetHintMin(new Eina.Size2D(360, 240));
etext.ChangedEvt += EditorChangedCb;
etext.ChangedUserEvt += EditorChangedCb;
box.DoPack(etext);
});
editorTextBox = new Efl.Ui.Text(box);
editorTextBox.SetFont("Mono", 14);
editorTextBox.SetMultiline(true);
editorTextBox.SetEditable(true);
editorTextBox.SetScrollable(true);
editorTextBox.SetHintMin(new Eina.Size2D(360, 240));
editorTextBox.ChangedEvt += EditorChangedCb;
editorTextBox.ChangedUserEvt += EditorChangedCb;
box.DoPack(editorTextBox);
// Initial refresh of the toolbar buttons
GUIToolbarRefresh();

@ -31,33 +31,33 @@ public class Example
mainloop.PollHighEvt += PollCb;
// This timer will control events fired by the main loop
new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
etimer.SetName("Timer");
var timer = new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
// Trigger every 100ms
etimer.SetInterval(0.1);
// To count number of timer triggers
int tick_count = 0;
etimer.TickEvt += (object sender, EventArgs e) => {
string message = "Tick {0} from {1}: ";
// Depending on the number of timer ticks, it does a different thing
switch (tick_count) {
case 0:
message += "Freezing Mainloop events";
mainloop.FreezeEvent();
break;
case 1:
message += "Thawing Mainloop events";
mainloop.ThawEvent();
break;
default:
message += "Quitting";
mainloop.Quit(new Eina.Value(0));
break;
}
Console.WriteLine(message, tick_count, ((Efl.Object)sender).GetName());
tick_count++;
};
});
timer.SetName("Timer");
// To count number of timer triggers
int tick_count = 0;
timer.TickEvt += (object sender, EventArgs e) => {
string message = "Tick {0} from {1}: ";
// Depending on the number of timer ticks, it does a different thing
switch (tick_count) {
case 0:
message += "Freezing Mainloop events";
mainloop.FreezeEvent();
break;
case 1:
message += "Thawing Mainloop events";
mainloop.ThawEvent();
break;
default:
message += "Quitting";
mainloop.Quit(new Eina.Value(0));
break;
}
Console.WriteLine(message, tick_count, ((Efl.Object)sender).GetName());
tick_count++;
};
Console.WriteLine("Waiting for Timer to call back...");

@ -34,14 +34,14 @@ public class Example
};
// Use a timer to exit the application
new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
var timer = new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
// Trigger after 10ms
etimer.SetInterval(0.01);
etimer.TickEvt += (object sender, EventArgs e) => {
Console.WriteLine("TIMER: timer callback called, exiting.");
mainloop.Quit(new Eina.Value(0));
};
});
timer.TickEvt += (object sender, EventArgs e) => {
Console.WriteLine("TIMER: timer callback called, exiting.");
mainloop.Quit(new Eina.Value(0));
};
// Start the EFL main loop (and the experiment)
mainloop.Begin();

@ -33,14 +33,14 @@ public class Example
};
// Use a timer to exit the application
new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
var timer = new Efl.LoopTimer(mainloop, (Efl.LoopTimer etimer) => {
// Trigger after 30s
etimer.SetInterval(30);
etimer.TickEvt += (object sender, EventArgs e) => {
Console.WriteLine("\nTIMER: timer callback called, exiting.");
mainloop.Quit(new Eina.Value(0));
};
});
timer.TickEvt += (object sender, EventArgs e) => {
Console.WriteLine("\nTIMER: timer callback called, exiting.");
mainloop.Quit(new Eina.Value(0));
};
// Start the EFL main loop (and the experiment)
mainloop.Begin();

@ -16,62 +16,57 @@ public class Example
Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
var win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Focus example");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
});
var win = new Efl.Ui.Win(null);
win.SetWinType(Efl.Ui.WinType.Basic);
win.SetText("Focus example");
win.SetAutohide(true);
win.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
// Create the main box container
var vbox = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
ebox.SetHintMin(new Eina.Size2D(360, 240));
win.SetContent(ebox);
});
var vbox = new Efl.Ui.Box(win);
vbox.SetHintMin(new Eina.Size2D(360, 240));
win.SetContent(vbox);
// Create some check boxes
Efl.Ui.Check first_checkbox = null;
for (int i = 0; i< 5; i++) {
var checkbox = new Efl.Ui.Check(vbox, (Efl.Ui.Check echeck) => {
echeck.SetText("Check " + i);
echeck.SetHintAlign(0.5, 0.5);
echeck.FocusChangedEvt += FocusChangedCb;
vbox.DoPack(echeck);
});
var checkbox = new Efl.Ui.Check(vbox);
checkbox.SetText("Check " + i);
checkbox.SetHintAlign(0.5, 0.5);
checkbox.FocusChangedEvt += FocusChangedCb;
vbox.DoPack(checkbox);
if (i == 0) first_checkbox = checkbox;
};
// Create an horizontal box to contain the two buttons
var hbox = new Efl.Ui.Box(vbox, (Efl.Ui.Box ebox) => {
ebox.SetDirection(Efl.Ui.Dir.Horizontal);
vbox.DoPack(ebox);
});
var hbox = new Efl.Ui.Box(vbox);
hbox.SetDirection(Efl.Ui.Dir.Horizontal);
vbox.DoPack(hbox);
// Create a "Focus Mover" button
new Efl.Ui.Button(hbox, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Focus mover");
ebutton.FocusChangedEvt += FocusChangedCb;
ebutton.ClickedEvt += (object sender, EventArgs e) => {
var button = new Efl.Ui.Button(hbox);
button.SetText("Focus mover");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, EventArgs e) => {
Console.WriteLine("Clicked Focus Mover");
// Manually transfer focus to the first check box
Efl.Ui.Focus.Util.Focus(first_checkbox);
};
hbox.DoPack(ebutton);
});
};
hbox.DoPack(button);
// Create a Quit button
new Efl.Ui.Button(hbox, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Quit");
ebutton.FocusChangedEvt += FocusChangedCb;
ebutton.ClickedEvt += (object sender, EventArgs e) => {
button = new Efl.Ui.Button(hbox);
button.SetText("Quit");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, EventArgs e) => {
Console.WriteLine("Clicked Quit");
Efl.Ui.Config.Exit();
};
hbox.DoPack(ebutton);
});
};
hbox.DoPack(button);
// Show the focus highlight
win.SetFocusHighlightEnabled(true);

@ -12,23 +12,21 @@ public class Example
// Create a box container full of buttons
static Efl.Ui.Box CreateBox(Efl.Ui.Win win)
{
Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
// Set distance between contained elements
ebox.SetPackPadding(5, 0, true);
});
Efl.Ui.Box box = new Efl.Ui.Box(win);
// Set distance between contained elements
box.SetPackPadding(5, 0, true);
for (int i = 1; i <= 4; ++i)
{
// Add 4 buttons, one below the other
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText($"Boxed {i}");
if (i == 2)
{
// Button 2 has its maximum size limited, so it will be smaller
ebutton.SetHintMax(new Eina.Size2D(100,50));
}
box.DoPack(ebutton);
});
var button = new Efl.Ui.Button(win);
button.SetText($"Boxed {i}");
if (i == 2)
{
// Button 2 has its maximum size limited, so it will be smaller
button.SetHintMax(new Eina.Size2D(100,50));
}
box.DoPack(button);
}
return box;
@ -37,26 +35,24 @@ public class Example
// Create a simple table layout
static Efl.Ui.Table CreateTable(Efl.Ui.Win win)
{
Efl.Ui.Table table = new Efl.Ui.Table(win, (Efl.Ui.Table etable) => {
// Table with two columns, that get filled left to right, and then top to bottom
etable.SetTableColumns(2);
etable.SetTableDirection(Efl.Ui.Dir.Right, Efl.Ui.Dir.Down);
});
Efl.Ui.Table table = new Efl.Ui.Table(win);
// Table with two columns, that get filled left to right, and then top to bottom
table.SetTableColumns(2);
table.SetTableDirection(Efl.Ui.Dir.Right, Efl.Ui.Dir.Down);
Efl.Ui.Button button;
for (int i = 1; i <= 4; ++i)
{
// Add 4 buttons, following the defined table flow
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText($"Table {i}");
table.DoPack(ebutton);
});
button = new Efl.Ui.Button(win);
button.SetText($"Table {i}");
table.DoPack(button);
}
// Last button spans two table cells
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Long Button");
table.PackTable(ebutton, 0, 2, 2, 1);
});
button = new Efl.Ui.Button(win);
button.SetText("Long Button");
table.PackTable(button, 0, 2, 2, 1);
return table;
}
@ -70,24 +66,22 @@ public class Example
Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Container demo");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
});
Efl.Ui.Win win = new Efl.Ui.Win(null);
win.SetWinType(Efl.Ui.WinType.Basic);
win.SetText("Container demo");
win.SetAutohide(true);
win.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
// Give the window an initial size so there is room to resize the panes.
// Otherwise, all widgets are tightly packed
win.SetSize(new Eina.Size2D(350,250));
// Create a vertically-split panes container
Efl.Ui.Panes vsplit = new Efl.Ui.Panes(win, (Efl.Ui.Panes epanes) => {
epanes.SetSplitRatio(0.75);
win.SetContent(epanes);
});
Efl.Ui.Panes vsplit = new Efl.Ui.Panes(win);
vsplit.SetSplitRatio(0.75);
win.SetContent(vsplit);
// Create some boxes and set them as the content of the first pane of the container
var box = CreateBox(win);
@ -95,10 +89,9 @@ public class Example
// Create a second, horizontally-split panes container and set it as the content of
// the second pane of the first container
Efl.Ui.Panes hsplit = new Efl.Ui.Panes(win, (Efl.Ui.Panes epanes) => {
epanes.SetDirection(Efl.Ui.Dir.Horizontal);
epanes.SetSplitRatio(0.85);
});
Efl.Ui.Panes hsplit = new Efl.Ui.Panes(win);
hsplit.SetDirection(Efl.Ui.Dir.Horizontal);
hsplit.SetSplitRatio(0.85);
Efl.ContentConcrete.static_cast(vsplit.GetPart("second")).SetContent(hsplit);
// Create a table and set it as the content of the first pane of the horizontal
@ -108,14 +101,13 @@ public class Example
// Create a button and set it as the content of the second pane of the horizontal
// container
Efl.Ui.Button quit_btn = new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Quit");
ebutton.SetHintMax(new Eina.Size2D(150, 30));
ebutton.ClickedEvt += (object sender, EventArgs e) => {
Efl.Ui.Button quit_btn = new Efl.Ui.Button(win);
quit_btn.SetText("Quit");
quit_btn.SetHintMax(new Eina.Size2D(150, 30));
quit_btn.ClickedEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
});
};
Efl.ContentConcrete.static_cast(hsplit.GetPart("second")).SetContent(quit_btn);
// Start the EFL main loop

@ -19,40 +19,35 @@ public class Example
Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Size Control");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
});
Efl.Ui.Win win = new Efl.Ui.Win(null);
win.SetWinType(Efl.Ui.WinType.Basic);
win.SetText("Size Control");
win.SetAutohide(true);
win.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};
// Create a box container
Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
win.SetContent(ebox);
});
Efl.Ui.Box box = new Efl.Ui.Box(win);
win.SetContent(box);
// Create a regular button (without size hints)
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Button");
box.DoPack(ebutton);
});
var button = new Efl.Ui.Button(win);
button.SetText("Button");
box.DoPack(button);
// Create a small button (max size is limited)
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Small");
ebutton.SetHintMax(new Eina.Size2D(50,50));
box.DoPack(ebutton);
});
button = new Efl.Ui.Button(win);
button.SetText("Small");
button.SetHintMax(new Eina.Size2D(50,50));
box.DoPack(button);
// Create a big button (min size is limited)
new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Big button");
ebutton.SetHintMin(new Eina.Size2D(100,100));
box.DoPack(ebutton);
});
button = new Efl.Ui.Button(win);
button.SetText("Big button");
button.SetHintMin(new Eina.Size2D(100,100));
box.DoPack(button);
// Start the EFL main loop
Efl.Ui.Config.Run();

@ -8,19 +8,16 @@ public class Example
static void ObjCreate()
{
// First create a root element
root = new Efl.ModelItem(null, (Efl.ModelItem eroot) => {
eroot.SetName("Root");
});
root = new Efl.ModelItem(null);
root.SetName("Root");
// Create the first child element
new Efl.ModelItem(root, (Efl.ModelItem eroot) => {
eroot.SetName("Child1");
});
var child = new Efl.ModelItem(root);
child.SetName("Child1");
// Create the second child element, this time, with an extra reference
child2 = new Efl.ModelItem(root, (Efl.ModelItem eroot) => {
eroot.SetName("Child2");
});
child2 = new Efl.ModelItem(root);
child2.SetName("Child2");
}
// Destroy the test hierarchy

@ -18,46 +18,42 @@ public class Example
Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain, (Efl.Ui.Win ewin) => {
// Set the window's title
ewin.SetText("Hello World");
// Request that the window is automatically hidden when the "close"
// button is pressed
ewin.SetAutohide(true);
// Hook to the Hide event
ewin.HideEvt += QuitCb;
});
Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain);
// Set the window's title
win.SetText("Hello World");
// Request that the window is automatically hidden when the "close"
// button is pressed
win.SetAutohide(true);
// Hook to the Hide event
win.HideEvt += QuitCb;
// Create a box container
Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
// Set its minimum size
ebox.SetHintMin(new Eina.Size2D(360, 240));
// Set the box as the content for the window
// The window size will adapt to the box size
win.SetContent(ebox);
});
var box = new Efl.Ui.Box(win);
// Set its minimum size
box.SetHintMin(new Eina.Size2D(360, 240));
// Set the box as the content for the window
// The window size will adapt to the box size
win.SetContent(box);
// Create a text label widget
new Efl.Ui.Text(box, (Efl.Ui.Text etext) => {
// Set its content and customize it
etext.SetText("Hello World. This is an Efl.Ui application!");
etext.SetSelectionAllowed(false);
etext.SetHintWeight(1.0, 0.9);
etext.SetHintAlign(0.5, 0.5);
// Add the text to the box container
box.DoPack(etext);
});
var label = new Efl.Ui.Text(box);
// Set its content and customize it
label.SetText("Hello World. This is an Efl.Ui application!");
label.SetSelectionAllowed(false);
label.SetHintWeight(1.0, 0.9);
label.SetHintAlign(0.5, 0.5);
// Add the text to the box container
box.DoPack(label);
// Create a button widget
new Efl.Ui.Button(box, (Efl.Ui.Button ebutton) => {
// Customize it
ebutton.SetText("Quit");
ebutton.SetHintWeight(1.0, 0.1);
// Set the method to be called when the button is pressed
ebutton.ClickedEvt += QuitCb;
// Add the button to the box container
box.DoPack(ebutton);
});
var button = new Efl.Ui.Button(box);
// Customize it
button.SetText("Quit");
button.SetHintWeight(1.0, 0.1);
// Set the method to be called when the button is pressed
button.ClickedEvt += QuitCb;
// Add the button to the box container
box.DoPack(button);
// Start the EFL main loop
Efl.Ui.Config.Run();

@ -11,13 +11,12 @@ public class Example
Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain, (Efl.Ui.Win ewin) => {
// Set the window's title
ewin.SetText("Hello World");
// Request that the window is automatically hidden when the "close"
// button is pressed
ewin.SetAutohide(true);
});
Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain);
// Set the window's title
win.SetText("Hello World");
// Request that the window is automatically hidden when the "close"
// button is pressed
win.SetAutohide(true);
// Window size must be explicitly set, otherwise it will be invisible
// due to its lack of content.
win.SetSize(new Eina.Size2D(360, 240));

Loading…
Cancel
Save