summaryrefslogtreecommitdiffstats
path: root/test/test_panel.rb
blob: ac04894759c22ee5864fc8771744bf0a1c9765b4 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'efl/elm/elm_win'
require 'efl/elm/elm_bg'
require 'efl/elm/elm_box'
require 'efl/elm/elm_panel'
require 'efl/elm/elm_label'
#
include Efl
#
class MyWin < Elm::ElmWin
  #
  def initialize
    super(nil, "Greetings") do
      title_set "Hello, World!"
      resize 240, 400
      show
    end
    @bg = Elm::ElmBg.new(self) do
      size_hint_weight_expand
      show
    end
    resize_object_add @bg
    #
    @bx = Elm::ElmBox.new(self) do
      horizontal_set false
      size_hint_weight_expand
      size_hint_align_fill
      show
    end
    resize_object_add @bx
    #
    @panel1 = Elm::ElmPanel.new(self) do
      orient_set :elm_panel_orient_top
      toggle
      size_hint_weight_expand
      size_hint_align_fill
      show
    end
    @bx.pack_end @panel1
    #
    @content = Elm::ElmLabel.new(self) do
      text_set "content 1"
      show
    end
    @panel1.content_set @content
    #
    @panel2 = Elm::ElmPanel.new(self) do
      orient_set :elm_panel_orient_right
      hidden_set true
      size_hint_weight_expand
      size_hint_align_fill
      show
    end
    @bx.pack_end @panel2
    #
    @content = Elm::ElmLabel.new(self) do
      text_set "content 2"
      show
    end
    @panel2.content_set @content
    #
    @panel3 = Elm::ElmPanel.new(self) do
      orient_set :elm_panel_orient_bottom
      size_hint_weight_expand
      size_hint_align_fill
      show
    end
    @bx.pack_end @panel3
    #
    @content = Elm::ElmLabel.new(self) do
      text_set "content 3"
      show
    end
    @panel3.content_set @content
  end
end
#
Elm.init
#
MyWin.new
#
Elm.run
Elm.shutdown
#
# EOF