Module: RubyMVC::Toolkit::WxRuby
- Defined in:
- lib/ruby_mvc/toolkit/peers/wxruby/app.rb,
lib/ruby_mvc/toolkit/peers/wxruby/frame.rb,
lib/ruby_mvc/toolkit/peers/wxruby/common.rb,
lib/ruby_mvc/toolkit/peers/wxruby/web_view.rb,
lib/ruby_mvc/toolkit/peers/wxruby/box_layout.rb
Defined Under Namespace
Modules: Common Classes: App, BoxLayout, Frame, WebView
Class Method Summary collapse
-
.default_parent ⇒ Object
This method is a hack to deal with the parenting issues around the way wxWindows requires a parent for all child windows, and other toolkits don’t.
-
.parent(options = {}) ⇒ Object
This method is used to retrieve the parent window from the options, or it will use the default parent window.
Class Method Details
.default_parent ⇒ Object
This method is a hack to deal with the parenting issues around the way wxWindows requires a parent for all child windows, and other toolkits don’t.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ruby_mvc/toolkit/peers/wxruby/common.rb', line 34 def self.default_parent @@parent ||= 1 if 1 == @@parent @@parent = Wx::Frame.new(nil, :size => [40, 40]) class << @@parent def should_prevent_app_exit false end end end @@parent end |
.parent(options = {}) ⇒ Object
This method is used to retrieve the parent window from the options, or it will use the default parent window.
50 51 52 53 54 55 56 |
# File 'lib/ruby_mvc/toolkit/peers/wxruby/common.rb', line 50 def self.parent( = {}) if (p = [:parent]) && (p = p.peer) p else default_parent end end |