Sha256: f18fc35b5f3a4a16526d0f52d1db367d2213796765322f9b55c678883fb13caf

Contents?: true

Size: 598 Bytes

Versions: 16

Compression:

Stored size: 598 Bytes

Contents

require_relative 'helpers/example_window'

# Labels can have text and/or icons.
class ExampleState < Fidgit::GuiState
  def initialize
    super

    vertical do
      my_label = label "No clicky"

      list do
        item "chunky bacon", :CHUNKYBACON, tip: "You prefer Chunky Bacon, don't you?"
        item "lentils", :LENTILS, tip: "Lentils? Well, I suppose someone has to like them"

        subscribe :changed do |sender, value|
          my_label.text = "I like #{value} more than anything in the world!"
        end
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fidgit-0.2.4 examples/list_example.rb
fidgit-0.2.3 examples/list_example.rb
fidgit-0.2.2 examples/list_example.rb
fidgit-0.2.1 examples/list_example.rb
fidgit-0.2.0 examples/list_example.rb
fidgit-0.1.10 examples/list_example.rb
fidgit-0.1.9 examples/list_example.rb
fidgit-0.1.8 examples/list_example.rb
fidgit-0.1.7 examples/list_example.rb
fidgit-0.1.6 examples/list_example.rb
fidgit-0.1.5 examples/list_example.rb
fidgit-0.1.4 examples/list_example.rb
fidgit-0.1.3 examples/list_example.rb
fidgit-0.1.2 examples/list_example.rb
fidgit-0.1.1 examples/list_example.rb
fidgit-0.1.0 examples/list_example.rb