[wxruby-users] Crash in evt_menu
Eric Rubin
erubin at valcom.com
Wed Jul 30 10:31:13 EDT 2008
I'm trying to create a TaskBarIcon with a right-click menu but I get a crash
(in the evt_menu call) as soon as I right-click on the icon.
Here's the error message:
C:/Projects/SoftPhone1/lib/SoftPhone.rb:35:in `process_event': Swig director
type mismatch in output value of type 'wxMenu *' (TypeError)
(The rescue doesn't catch the error).
Here's the code (it doesn't matter which variant of the evt_menu call I
use):
class SysTrayIcon < TaskBarIcon
def initialize(parent)
super()
@softPhone = parent # soft_phone_frame
icon = Icon.new("icons/phone.ico", BITMAP_TYPE_ICO)
set_icon(icon, "Valcom VIP Page")
end
def create_popup_menu
menu = Menu.new
close_item = menu.append(101, 'Close VIP-Page', 'Close VIP-Page')
evt_menu(close_item, :on_close)
# evt_menu(close_item) {|event| on_close(event)}
rescue Exception => e
puts "create_popup_menu #{e}"
end
def on_close(event)
@softphone.exit
end
end
Any suggestions?
Eric Rubin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20080730/64983909/attachment.html>
More information about the wxruby-users
mailing list