On 8/1/12 7:59 AM, Jonas Pfannschmidt wrote:
> Hi all,
>
> I need to use the undocumented method
> wxNotificationMessage->UseTaskBarIcon (see
>
http://forums.wxwidgets.org/viewtopic.php?t=30085&p=129075 for details).
> So I added it to the _misc.i file like this:
> wxPyTaskBarIcon * UseTaskBarIcon(wxPyTaskBarIcon * icon);
>
> This fails during build:
> src\msw\_misc_wrap.cpp(11706) : error C2664:
> 'wxNotificationMessage::UseTaskBarIcon' : cannot convert parameter 1
> from 'wxPyTaskBarIcon *' to 'wxTaskBarIcon *'
> Types pointed to are unrelated; conversion requires reinterpret_cast,
> C-style cast or function-style cast
>
> When I add "%include _taskbar.i" to the file _misc.i it builds fine. I
> get a runtime warning ("wxTaskBarIcon" already in RTTI table) but if I
> ignore it the new method works as expected.
>
> I guess I need to include/import it differently to get rid of the
> runtime warning but I don't have any SWIG experience so I don't know
> where to start. Any ideas?
You should probably move the declaration of the custom wxPyTaskbarIcon
class to a .h file so it can be #included from both locations. You may
have some link problems if there is anything in the wxPy class needs to
be used from the other location and since they are in different
extension modules. If so then you may need to reorganize things so they
both end up in the same extension.
>
> Btw. What is the wxPython policy for undocumented wxWidgets features? Do
> you include them?
Sometimes. It depends on the importance and usability of the
functionality it provides. For methods that are only present on one
platform I usually try to add a stub for the other platforms that either
does nothing or raises a NotImplementedError
> If needed, I'd be happy to provide a patch as soon as
> I get this fixed.
>
> Thanks for all the great work
>
> Regards,
> Jonas
>
> --
> To unsubscribe, send email to
wxPython-dev...@googlegroups.com
> or visit
http://groups.google.com/group/wxPython-dev?hl=en
--
Robin Dunn
Software Craftsman
http://wxPython.org