Sha256: 230243ba6fe464bfdfab2214f0e65c5e89bb8545d783aff6fe35fa6dd727f522
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
require 'swing/action_listener' require 'swing/attr_setter' module Clients # Swing-based GUI controls module SwingGui 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 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 class Label < javax.swing.JLabel include AttrSetter def initialize text, opts = {}, &block set_attributes(opts) { super(text) } opts[:parent].add self if opts[:parent] end end # class Label end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
swing-0.0.1 | lib/swing/controls.rb |