Sha256: c084b399d55389a78673cfc6741f2db03b0b11e73e19200c1c39573b59916596
Contents?: true
Size: 516 Bytes
Versions: 56
Compression:
Stored size: 516 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 { # data-bind button text to self count, converting to string on read. text <= [self, :count, on_read: ->(count) {"Count: #{count}"}] on_clicked do self.count += 1 end } } }.show end end ButtonCounter.new.launch
Version data entries
56 entries across 56 versions & 1 rubygems