Sha256: 68b404a7ff16fb8d5a9832d45913eb396e4f6e940ff9e214beb28f1ad51bed2c

Contents?: true

Size: 621 Bytes

Versions: 117

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

require 'glimmer-dsl-libui'

include Glimmer

data = [
  ['task 1', 0],
  ['task 2', 15],
  ['task 3', 100],
  ['task 4', 75],
  ['task 5', -1],
]

window('Task Progress', 300, 200) {
  vertical_box {
    table {
      text_column('Task')
      progress_bar_column('Progress')

      cell_rows data # implicit data-binding
    }
    
    button('Mark All As Done') {
      stretchy false
      
      on_clicked do
        data.each_with_index do |row_data, row|
          data[row][1] = 100 # automatically updates table due to implicit data-binding
        end
      end
    }
  }
}.show

Version data entries

117 entries across 117 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.12.7 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.6 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.5 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.4 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.3 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.2 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.1 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.12.0 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.10 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.9 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.8 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.7 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.6 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.5 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.4 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.3 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.2 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.1 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.11.0 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.10.2 examples/basic_table_progress_bar.rb