Sha256: 556b348a0c35de997df493bd9a45de014423255a8b294984668d964b423e5ae6

Contents?: true

Size: 800 Bytes

Versions: 6

Compression:

Stored size: 800 Bytes

Contents

require_relative 'helpers/example_window'

# Example for Button and ToggleButton
class ExampleState < Fidgit::GuiState
  def initialize
    super

    vertical do
      my_label = label "Label", tip: "I'm a label"

      my_button = button("Button", tip: "I'm a button; press me!", shortcut: :auto) do
        my_label.text = "Pressed the button!"
      end

      my_toggle_button = toggle_button("ToggleButton", tip: "I'm a button that toggles", shortcut: :o) do |sender, value|
        my_label.text = "Turned the toggle button #{value ? "on" : "off"}!"
      end

      toggle_button("Enable other two buttons", value: true) do |sender, value|
        my_button.enabled = value
        my_toggle_button.enabled = value
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fidgit-0.1.5 examples/button_and_toggle_button_example.rb
fidgit-0.1.4 examples/button_and_toggle_button_example.rb
fidgit-0.1.3 examples/button_and_toggle_button_example.rb
fidgit-0.1.2 examples/button_and_toggle_button_example.rb
fidgit-0.1.1 examples/button_and_toggle_button_example.rb
fidgit-0.1.0 examples/button_and_toggle_button_example.rb