Sha256: 3a93b3e1ac8f805e05880213e53c2979632c4e290b50258d7da53a6f38bb1576

Contents?: true

Size: 633 Bytes

Versions: 17

Compression:

Stored size: 633 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] = [row_data[0], 100] # automatically updates table due to implicit data-binding
        end
      end
    }
  }
}.show

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.2.8 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.7 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.6 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.5 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.4 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.3 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.2 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.1 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.2.0 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.11 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.10 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.9 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.8 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.7 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.6 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.5 examples/basic_table_progress_bar.rb
glimmer-dsl-libui-0.1.4 examples/basic_table_progress_bar.rb