On Apr 15, 2011, at 8:37 AM, adwelly wrote:
> I am trying to get wxPython 2.9.1 Cocoa and VLC, via vlc.py to playWell, this is quite a pickle. :( You *might* be able to do some really black magic using PyObjC to solve this issue by dynamically adding those methods to your wxPanel's underlying NSView. It would go something like this:
> together nicely. I've managed to do this with wxPython 2.8 under
> windows and linux
> but ran into a problem with 2.8 on a Mac.
> The issue is that once a nice UI has been set up with wxPython, vlc
> On linux using X the process is similar. Call wx.Panel.GetHandle() and
> Under wx 2.8 the problem arises that although vlc.MediaPlayer has a
> I've now installed wx 2.9.1 for cocoa and python 2.7.1 It builds an
> The actual error I'm getting is:
> -[wxNSView addVoutSubview:]: unrecognized selector sent to instance
> so I guess the wxNSView object that represents a panel can't currently
def addVoutSubview_(self, subview):
def removeVoutSubview_(self, subview):
Note that this is all untested pseudocode, so no guarantees. If all goes well, then after this code is run, try the set_nsobject() function again and it should work. Hooray for Objective C having some of the dynamic dispatch of languages like Python. :)
In any case, I'd file a bug in the wx trac about not being able to create a wxWindow from a native handle cross-platform. It should definitely be possible, and it would make situations like this much easier. Then you could just create an NSView subclass in PyObjC, add those methods to it, and do wx.Window(myNSView) or some such to create the wx.Window. Resorting to black magic like this (which actually adds those methods to *all* NSViews) is, I think, far from ideal, and this would not have worked at all had we been dealing with C / C++.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.