Sha256: 1405c796568bbb121d6c98a69ab5d38944b013c49cc5119873fce735e0e5becd

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

require_relative 'helpers/example_window'

class ExampleState < Fidgit::GuiState
  def initialize
    super

    pack :vertical do
      my_label = label "No color selected."

      group do
        pack :grid, num_columns: 15, padding: 0, spacing: 4 do
          150.times do
            color_well(color: Gosu::Color.rgb(rand(255), rand(255), rand(255)))
          end
        end

        subscribe :changed do |sender, color|
          my_label.text = color.to_s
        end
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fidgit-0.0.6alpha examples/color_well_example.rb
fidgit-0.0.5alpha examples/color_well_example.rb
fidgit-0.0.4alpha examples/color_well_example.rb
fidgit-0.0.3alpha examples/color_well_example.rb
fidgit-0.0.2alpha examples/color_well_example.rb