Class: RubyMVC::Toolkit::WxRuby::App

Inherits:
Wx::App
  • Object
show all
Defined in:
lib/ruby_mvc/toolkit/peers/wxruby/app.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, &block) ⇒ App

Returns a new instance of App.



32
33
34
35
36
37
# File 'lib/ruby_mvc/toolkit/peers/wxruby/app.rb', line 32

def initialize(options, &block)
  super()
  @block = block
  @options = options
  main_loop
end

Instance Method Details

#on_initObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/ruby_mvc/toolkit/peers/wxruby/app.rb', line 39

def on_init
  if icon = @options[:icon]

# FIXME: the following does what yu expect, but the issue is
# that we need to destroy it when the last application window
# is closed (meaning we also need to track windows for this
# too).  tbicon.remove_icon should cause everything to shut
# down the way we expect.  What a PITA!!!
#
#            if Wx::PLATFORM == "WXMAC"
#              # ensure we have a dock icon set
#              tbicon = Wx::TaskBarIcon.new
#              tbicon.set_icon(WxRuby.load_icon(icon), @options[:title])
#              class << tbicon
#                def create_popup_menu
#                  puts "popup menu"
#                  Wx::Menu.new
#                end
#              end
#            end
  end
  @block.call
end