Sha256: 8233bb16b13a0b31be850fc6ec14d18c945854356b82a8d108244be77a64f7b5

Contents?: true

Size: 593 Bytes

Versions: 25

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

require 'glimmer-dsl-libui'

include Glimmer

data = [
  %w[cat meow delete],
  %w[dog woof delete],
  %w[chicken cock-a-doodle-doo delete],
  %w[horse neigh delete],
  %w[cow moo delete]
]

window('Animal sounds', 300, 200) {
  horizontal_box {
    table {
      text_column('Animal')
      text_column('Description')
      button_column('Action') {
        on_clicked do |row|
          data.delete_at(row) # automatically deletes actual table row due to implicit data-binding
        end
      }

      cell_rows data # implicit data-binding
    }
  }
}.show

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.2.7 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.6 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.5 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.4 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.3 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.2 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.1 examples/basic_table_button.rb
glimmer-dsl-libui-0.2.0 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.11 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.10 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.9 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.8 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.7 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.6 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.5 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.4 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.3 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.2 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.1 examples/basic_table_button.rb
glimmer-dsl-libui-0.1.0 examples/basic_table_button.rb