Sha256: fe263e038d4d952507eba7de2ad1245d2a08b41bcf8f7e6420be75093ec9536f

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

box({color: :gray, width: 666, height: 666})
box({ id: :the_box, drag: true, color: { alpha: 2 } })

menu1_code = lambda do
  puts :menu1_code
end
menu2_code = lambda do
  puts :menu2
end

but = buttons({
                id: :menu1,
                attach: :the_box,
                inactive: { text: { color: :gray }, width: 66, height: 12, spacing: 3, disposition: :horizontal,
                            color: :orange, margin: { left: 33, top: 12 } },
                active: { text: { color: :white, shadow: {} }, color: :blue, shadow: {} },
                item_1: {
                  text: :acceuil,
                  code: menu1_code
                },
                item_2: {
                  text: :page_2,
                  code: menu2_code

                },
                item_3: {
                  text: :page_3,
                  code: lambda { puts :item_3_touched }
                },
              })

c = text({ top: 99, left: 99, data: 'add a button' })

c.touch(:down) do
  but.add_button(new_button: {
    text: :button1,
    code: lambda { puts :button1_touched }
  })
end


wait 2 do
  grab(:menu1).remove_menu_item(:item_2)
end

# TODO: remove menu_item ,reset_menu, reorder, delete

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
atome-0.5.7.4.8 vendor/assets/application/examples/buttons.rb
atome-0.5.7.4.7 vendor/assets/application/examples/buttons.rb
atome-0.5.7.4.6 vendor/assets/application/examples/buttons.rb
atome-0.5.7.4.3 vendor/assets/application/examples/buttons.rb
atome-0.5.7.4.2 vendor/assets/application/examples/buttons.rb