Sha256: 65d453789f501476b8bbc376f0c054df9cbf10618458704fb03045ef373c8af1

Contents?: true

Size: 418 Bytes

Versions: 13

Compression:

Stored size: 418 Bytes

Contents

require 'swing'
require 'swing/action_listener'

module Swing
  class CheckBox < javax.swing.JCheckBox

    attr_setter :selected

    def initialize text, opts = {}, &block
      set_attributes(opts) { super(text) }

      # TODO: Probably need to implement ItemListener as well?
      self.addActionListener ActionListener.new &block

      opts[:parent].add self if opts[:parent]
    end
  end # class CheckBox
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
swing-0.1.16 lib/swing/old/check_box.rb
swing-0.1.15 lib/swing/old/check_box.rb
swing-0.1.14 lib/swing/old/check_box.rb
swing-0.1.12 lib/swing/old/check_box.rb
swing-0.1.10 lib/swing/old/check_box.rb
swing-0.1.8 lib/swing/old/check_box.rb
swing-0.1.7 lib/swing/old/check_box.rb
swing-0.1.5 lib/swing/old/check_box.rb
swing-0.1.4 lib/swing/old/check_box.rb
swing-0.1.3 lib/swing/old/check_box.rb
swing-0.1.2 lib/swing/old/check_box.rb
swing-0.1.1 lib/swing/old/check_box.rb
swing-0.1.0 lib/swing/old/check_box.rb