Closed xinhuang closed 6 years ago
Please try to use wx.ToMouseEvent(e)
, which is something like reinterpret_cast<wxMouseEvent*>
in C++. Types are erased during callback.
BTW, it is invalid to use "type conversion" to convert a base interface into a "derived" interface in Go. Instead, you should use "type assertion": x.(T)
. However, as the types are erased, this type assertion way also won't work in wxGo callback functions.
Oh sorry. That's a silly mistake. The C++ part of my brain just jumped in to my go program. :P
I have following code snippet to handle double clicks:
But the compiler complains about the conversion:
I checked
wxGo/src/wxGoInterface/event.h
but didn't findAltDown
method inwx.MouseEvent
. Is there anything I did wrong?Thanks!