Skip to content

Commit

Permalink
better binary
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Oct 13, 2012
1 parent c86329d commit 39be67f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/simple_gui_creator
Expand Up @@ -13,7 +13,7 @@ if !OS.jruby?
exit 1
end

require 'simple_gui_creator'#File.dirname(__FILE__) + "/../lib/simple_gui_creator.rb"
require File.dirname(__FILE__) + "/../lib/simple_gui_creator.rb"

class TestWindow < SimpleGuiCreator::ParseTemplate

Expand All @@ -22,7 +22,7 @@ class TestWindow < SimpleGuiCreator::ParseTemplate
string = <<-EOL
---------- Simple Ruby Gui Creator Test Window ----------------------------------------
| "Edit this, then..." |
| [Test it out! :test_it_out_button] [Insert code for this window:replace_button] |
| [Test it out! :test_it_out_button] |
| [ :text_area_to_use, width=70chars, height=500, font=fixed_width] |
| [ ] |
| [ ] |
Expand All @@ -32,7 +32,7 @@ class TestWindow < SimpleGuiCreator::ParseTemplate
| [ ] |
| [ ] |
| |
| [Create code snippet :create_snippet] |
| [Create code snippet :create_snippet] [Insert code for this window:replace_button] |
---------------------------------------------------------------------------------------
EOL
parse_setup_string string
Expand Down
14 changes: 13 additions & 1 deletion lib/simple_gui_creator/swing_helpers.rb
Expand Up @@ -5,7 +5,7 @@ module SimpleGuiCreator
include_package 'javax.swing'
# and use these constants (bug: http://jira.codehaus.org/browse/JRUBY-5107)
[JProgressBar, JButton, JLabel, JPanel, JOptionPane,
JFileChooser, JComboBox, JDialog, SwingUtilities, JFrame, JSlider, JPasswordField, JCheckBox, UIManager]
JFileChooser, JComboBox, JDialog, SwingUtilities, JFrame, JSlider, JPasswordField, JCheckBox, AbstractButton, UIManager]

include_package 'java.awt'; [Font, FileDialog]

Expand Down Expand Up @@ -270,4 +270,16 @@ def on_clicked &block

end

class AbstractButton # like JCheckBox, et al

def disable!
setEnabled(false)
end

def enable!
setEnabled(true)
end

end

end

0 comments on commit 39be67f

Please sign in to comment.