Sha256: e7f4d594e203f33103c37d7c4bb0c0976742cb5e58267abd33a0a8443631bccf

Contents?: true

Size: 453 Bytes

Versions: 2

Compression:

Stored size: 453 Bytes

Contents

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swing-0.0.5 lib/swing/check_box.rb
swing-0.0.3 lib/swing/check_box.rb