Class: RSwing::Components::Frame
- Includes:
- Window
- Defined in:
- lib/rswing/components/frame.rb
Constant Summary
Constants included from Events::WindowFocus
Events::WindowFocus::WindowFocusListener
Constants included from Events::WindowState
Events::WindowState::WindowStateListener
Constants included from Events::PropertyChanged
Events::PropertyChanged::PropertyChangeListener
Constants included from Events::ContainerEvents
Events::ContainerEvents::ContainerListener
Constants included from Events::FocusEvents
Events::FocusEvents::FocusListener
Constants included from Events::InputMethodEvents
Events::InputMethodEvents::InputMethodListener
Constants included from Events::HierarchyBoundsEvents
Events::HierarchyBoundsEvents::HierarchyBoundsListener
Constants included from Events::KeyEvents
Events::KeyEvents::KeyListener
Constants included from Events::MouseWheelEvents
Events::MouseWheelEvents::MouseWheelListener
Constants included from Events::MouseMotionEvents
Events::MouseMotionEvents::MouseMotionListener
Constants included from Events::MouseEvents
Events::MouseEvents::MouseListener
Constants included from Events::ComponentEvents
Events::ComponentEvents::ComponentListener
Instance Method Summary collapse
-
#default_close_operation=(op = :hide_on_close) ⇒ Object
Sets the default close operation for this frame.
-
#initialize(title, options = {}, &block) ⇒ Frame
constructor
valid options are: 1.
Methods included from Window
Methods included from Events::WindowFocus
Methods included from Container
#[], #add, add_if_requested, #add_with_name, #components, #remove
Methods included from Events::ContainerEvents
Methods included from Events::FocusEvents
Methods included from Events::InputMethodEvents
Methods included from Events::HierarchyBoundsEvents
Methods included from Events::KeyEvents
Methods included from Events::MouseMotionEvents
Methods included from Events::MouseEvents
Methods included from Events::ComponentEvents
Constructor Details
#initialize(title, options = {}, &block) ⇒ Frame
valid options are:
-
:size => [800, 600]800x600 pixels (default: nil)
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rswing/components/frame.rb', line 29 def initialize(title, = {}, &block) super(title) Window.init(self, ) # falls block übergeben wurde, mit aktuellem objekt aufrufen if block_given? yield self end end |
Instance Method Details
#default_close_operation=(op = :hide_on_close) ⇒ Object
Sets the default close operation for this frame. Valid operations are:
-
:do_nothing_on_close -
:hide_on_close(default) -
:dispose_on_close -
:exit_on_close
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rswing/components/frame.rb', line 46 def default_close_operation=(op = :hide_on_close) case op when :do_nothing_on_close self.setDefaultCloseOperation(WindowConstants::DO_NOTHING_ON_CLOSE) when :hide_on_close self.setDefaultCloseOperation(WindowConstants::HIDE_ON_CLOSE) when :dispose_on_close self.setDefaultCloseOperation(WindowConstants::DISPOSE_ON_CLOSE) when :exit_on_close self.setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE) end end |