Sha256: 2f0e326777868b5b8786a4277ee3deb191cd2041ced06c1398d948835595a22a

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

require 'swing/action_listener'
require 'swing/attr_setter'

module Clients
  module Swing

    class CheckBox < javax.swing.JCheckBox
      include AttrSetter

      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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swing-0.0.2 lib/swing/check_box.rb