summaryrefslogtreecommitdiffstats
path: root/test/test_button.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_button.rb')
-rw-r--r--test/test_button.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test_button.rb b/test/test_button.rb
new file mode 100644
index 0000000..93168d3
--- /dev/null
+++ b/test/test_button.rb
@@ -0,0 +1,40 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/elm/elm_win'
+require 'efl/elm/elm_bg'
+require 'efl/elm/elm_button'
+#
+include Efl
+#
+class MyWin < Elm::ElmWin
+ #
+ def initialize
+ super(nil, "Greetings") do
+ title_set "Hello, World!"
+ resize 240, 60
+ show
+ end
+ @bg = Elm::ElmBg.new(self) do
+ size_hint_weight_expand
+ show
+ end
+ resize_object_add @bg
+ @btn = Elm::ElmButton.new(self) do
+ part_text_set(nil, "Good-Bye, World!")
+ smart_callback_add("clicked", ->(*_) { Elm.exit }, nil)
+ resize 120, 30
+ move 60, 15
+ show
+ end
+ end
+end
+#
+Elm.init
+#
+MyWin.new
+#
+Elm.run
+Elm.shutdown
+#
+# EOF