blob: 93168d3ed89da84856cca0b05e3a8a2e8c3f46bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
|