Sha256: dacf80b2f6c3ce0c9067e0942805790206cbd87b4ed1af4e176d09e8bfcf8c8d

Contents?: true

Size: 813 Bytes

Versions: 32

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

require 'glimmer-dsl-libui'

include Glimmer

data = [
  ['cat', 'meow', true],
  ['dog', 'woof', true],
  ['chicken', 'cock-a-doodle-doo', false],
  ['horse', 'neigh', true],
  ['cow', 'moo', true]
]

window('Animal sounds', 400, 200) {
  horizontal_box {
    table {
      text_column('Animal')
      text_column('Description')
      checkbox_column('Mammal') {
        editable true
      }

      cell_rows data
      
      on_changed do |row, type, row_data| # fires on all changes (even ones happening through data array)
        puts "Row #{row} #{type}: #{row_data}"
        $stdout.flush
      end
      
      on_edited do |row, row_data| # only fires on direct table editing
        puts "Row #{row} edited: #{row_data}"
        $stdout.flush
      end
    }
  }
}.show

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.11.7 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.6 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.5 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.4 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.3 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.2 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.1 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.11.0 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.10.2 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.10.1 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.10.0 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.7 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.6 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.5 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.4 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.3 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.2 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.1 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.9.0 examples/basic_table_checkbox.rb
glimmer-dsl-libui-0.8.0 examples/basic_table_checkbox.rb