Sha256: 0bfe260e61b4c09dbb43600b89fb51ac10e034154779eb6b44172e909e88cc09
Contents?: true
Size: 992 Bytes
Versions: 5
Compression:
Stored size: 992 Bytes
Contents
require 'spec_helper' require 'swing/shared' describe Swing::JMenuBar do context 'creation' do let(:new_args) { [] } it_behaves_like 'enhanced Awt::Component' it_behaves_like 'enhanced Swing::JComponent' it 'allows to pass parent in as option' do @frame = Swing::JFrame.new 'Menu Test' bar = Swing::JMenuBar.new :parent => @frame bar.parent.should == @frame.layered_pane @frame.dispose end it 'allows to set menu structure via options' do # Creating Connect/Disconnect buttons (parentless - detached, for now) @connect_button = Swing::JButton.new('Connect') # Creating Menu Bar with buttons Swing::JMenuBar.new :structure => [ @connect_button, @beep_button = Swing::JButton.new('Beep'), {:File => {:Exit => Proc.new { sleep 1 }}} ] end end end
Version data entries
5 entries across 5 versions & 1 rubygems