Sha256: f62660c91c0e39e9526cc18a82165b7d1678baec38674a0ce923209cdc3ce772
Contents?: true
Size: 506 Bytes
Versions: 6
Compression:
Stored size: 506 Bytes
Contents
require 'glimmer-dsl-libui' class ButtonCounter include Glimmer attr_accessor :count def initialize @count = 0 end def launch window('Hello, Button!', 190, 20) { vertical_box { button { text <= [self, :count, on_read: ->(count) {"Count: #{count}"}] # data-bind button text to self count, converting to string on read. on_clicked do self.count += 1 end } } }.show end end ButtonCounter.new.launch
Version data entries
6 entries across 6 versions & 1 rubygems