buat yang mo develop GUI di Ruby: (JRuby sih)

http://ihate.rubyforge.org/profligacy/

    Profligacy is a JRuby library that makes building Swing Graphical
    User Interface much easier than with Raw code. It's not a builder as
    with many other projects, but instead a simple Ruby way to structure
    the UI for the 80% common cases you'll encounter.

    It's actively used in the Utu iHate client. iHate started as a
    RubyCocoa project and then convert to JRuby and Swing.



Sample code:

require 'profligacy/swing'

module Buttons
  class ButtonDemo
    include_package 'javax.swing'
    include_package 'java.awt'
    include Profligacy

    def initialize
      @ui = Swing::Build.new JFrame, :first, :second, :lab do |c,i|
        c.lab = JLabel.new "Press A Button." 
        c.first = JButton.new "First" 
        c.second = JButton.new "Second" 

        i.first = { :action => proc {|t,e| c.lab.text = "First pressed." } }
        i.second = { :action => proc {|t,e| c.lab.text = "Second pressed." } }
      end

      @ui.layout = FlowLayout.new
      @ui.build("The Sample Layout").default_close_operation = 
JFrame::EXIT_ON_CLOSE
    end
  end
end

SwingUtilities.invoke_later proc { Buttons::ButtonDemo.new }.to_runnable


-- 
Hendy Irawan
www.hendyirawan.com



[Non-text portions of this message have been removed]

Kirim email ke