This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch main
in repository ego.
View the commit online.
commit 5c96afe321adfc52cc0e0a068404f9e57b51be04
Author: [email protected] <[email protected]>
AuthorDate: Mon Mar 9 21:31:22 2026 -0600
feat: add hello_world example demonstrating generated Go bindings
This simple EFL GUI application showcases the generated Go bindings
in action without any cgo hacks. It creates a window with a label,
text entry, and button—clicking the button updates the label with
"Hello " + entry text + "!". The example works purely through generated
bindings thanks to the mixin method forwarding added in the previous
commit.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
examples/hello_world/main.go | 53 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/examples/hello_world/main.go b/examples/hello_world/main.go
new file mode 100644
index 0000000..51890b7
--- /dev/null
+++ b/examples/hello_world/main.go
@@ -0,0 +1,53 @@
+// Hello World — a simple EFL application using generated Go bindings.
+//
+// Creates a window with a label ("Hello world!"), a text entry initialized
+// with "world", and a button. Pressing the button updates the label to
+// "Hello " + <entry text> + "!".
+package main
+
+import (
+ "unsafe"
+
+ "git.enlightenment.org/cedric/ego/efl"
+ "git.enlightenment.org/cedric/ego/efl/ui"
+)
+
+func main() {
+ efl.Init()
+
+ efl.Sync(func() {
+ // Window
+ win := ui.NewWin(nil)
+ win.SetWinName("hello_world")
+ win.SetText("Hello World")
+
+ // Vertical box as the window content.
+ box := ui.NewBox(win)
+ win.SetContent(box.Eo())
+
+ // Label (a non-editable textbox).
+ label := ui.NewTextbox(box)
+ label.SetText("Hello world!")
+ box.PackEnd(label.Eo())
+
+ // Editable text entry, initialized with "world".
+ entry := ui.NewTextbox(box)
+ entry.SetText("world")
+ box.PackEnd(entry.Eo())
+
+ // Button that updates the label.
+ btn := ui.NewButton(box)
+ btn.SetText("Greet")
+ box.PackEnd(btn.Eo())
+
+ btn.OnClicked(func(_ unsafe.Pointer) {
+ label.SetText("Hello " + entry.Text() + "!")
+ })
+
+ win.OnDeleteRequest(func() {
+ efl.Shutdown()
+ })
+ })
+
+ efl.Wait()
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.