Class: SensibleSwing::GetDisk

Inherits:
JDialog
  • Object
show all
Defined in:
lib/gui/sensible-cinema-base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, options_array) ⇒ GetDisk

Returns a new instance of GetDisk.



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/gui/sensible-cinema-base.rb', line 604

def initialize parent, options_array
  super parent, true

  box = JComboBox.new
  box.add_action_listener do |e|
    idx = box.get_selected_index
    if idx != 0
      # don't count choosing the first as a real entry
      @selected_idx = box.get_selected_index - 1
      dispose
    end
  end

  box.add_item "Click to select DVD drive" # put something in index 0
  options_array.each{|drive|
    box.add_item drive
  }
  add box
  pack # how do you get this arbitrary size? what the...
end

Instance Attribute Details

#selected_idxObject (readonly)

Returns the value of attribute selected_idx.



603
604
605
# File 'lib/gui/sensible-cinema-base.rb', line 603

def selected_idx
  @selected_idx
end