Sha256: b7c4283b781ea9d6c9fa7c85dbefe2dd11c8aad3893953dcebce062a0d400606

Contents?: true

Size: 1.91 KB

Versions: 7

Compression:

Stored size: 1.91 KB

Contents

# frozen_string_literal: true
bb=text({data: :hello })
#
bb.touch(true) do
  bb.left(333)
end

# alert grab(:view).attached
bb.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |_atome, _element, value|
  puts "the left value of #{id} was change to : #{value}"
end

a = text({ data: "open the console!" })
a.right(44).left(66)
color({red: 1, id: :the_red_col})
b = Atome.new(shape: { type: :shape, id: :my_shape, attach: [:view], renderers: [:browser],
                       left: 0, right: 33, attached: :the_red_col, width: 33, height: 33
})

c = Atome.new(shape: { type: :shape, id: :my_pix,  attach: [:view], renderers: [:browser],
                       left: 50, right: 78, attached: :the_red_col, width: 33, height: 33
})




b.left(936)
wait 0.5 do
  b.left(777)
  wait 0.5 do
    c.left(888)
  end
end

puts "bb monitor is #{bb.monitor}"

# test 2
aa = text({ data: 'touch me and look in the console', top: 99, width: 399, left: 120 })


bb=box({ id: :the_boxy })

aa.touch(true) do
  aa.color(:red)
  aa.left(333)
  aa.width(555)
  aa.right(4)
  aa.height(199)
end
bb.drag(true)
bb.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |_atome, _element, value|
  puts "the left value of #{id} was change to : #{value}"
end

bb.monitor({ atomes: grab(:view).attached, particles: [:top] }) do |_atome, _element, value|
  puts "the top value of #{id} was change to : #{value}"
end

bb.monitor({ atomes: grab(:view).attached, particles: [:width] }) do |_atome, _element, value|
  puts "the width's value of #{id} was change to : #{value}"
end

bb.monitor({ atomes: grab(:view).attached, particles: [:left], id: :my_monitorer }) do |_atome, _element, value|
  puts "the second monitor left value of #{id} was log to : #{value}"
end
# puts aa.monitor
bb.top(66)
a.monitor({ atomes: grab(:view).attached, particles: [:left] }) do |atome, element, value|
  puts "monitoring  #{id} : #{atome.id}, #{element}, #{value}"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
atome-0.5.4.1.9 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.1.7 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.1.3 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.1.2 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.1.1 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.1.0 vendor/assets/src/medias/rubies/examples/monitoring.rb
atome-0.5.4.0.9 vendor/assets/src/medias/rubies/examples/monitoring.rb