Sha256: 05ad5a7f2c6ae0bb8c2b7f41f0591aa3d9f4c24a7d3f4c69adbdb49b2459f8f3

Contents?: true

Size: 384 Bytes

Versions: 2

Compression:

Stored size: 384 Bytes

Contents

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

module Swing

  class Button < javax.swing.JButton
    include AttrSetter

    attr_setter :enabled

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

      self.addActionListener ActionListener.new &block

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

Version data entries

2 entries across 2 versions & 1 rubygems

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