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/dialog.rb,
lib/ruby_mvc/toolkit/peers/wxruby/web_view.rb,
lib/ruby_mvc/toolkit/peers/wxruby/grid_view.rb,
lib/ruby_mvc/toolkit/peers/wxruby/box_layout.rb,
lib/ruby_mvc/toolkit/peers/wxruby/grid_model.rb,
lib/ruby_mvc/toolkit/peers/wxruby/messagebox.rb,
lib/ruby_mvc/toolkit/peers/wxruby/form_builder.rb
Defined Under Namespace
Modules: Common Classes: App, BoxLayout, Dialog, FormBuilder, Frame, GridModel, GridView, MessageBox, 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.
- .load_icon(path, size = nil) ⇒ Object
-
.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 |
.load_icon(path, size = nil) ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/ruby_mvc/toolkit/peers/wxruby/common.rb', line 58 def self.load_icon(path, size = nil) img = Wx::Image.new(path) if size img = img.scale(size, size) end icon = Wx::Icon.new icon.copy_from_bitmap(Wx::Bitmap.new(img)) icon 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 |