[Pythonmac-SIG] Can any cross platform gui framework limitations be filled with ctypes / pyobjc or other?

Ronald Oussoren ronaldoussoren at mac.com
Tue Jul 9 15:19:13 CEST 2013


On 9 Jul, 2013, at 15:15, Paul Wiseman <poalman at gmail.com> wrote:

> On 9 July 2013 14:08, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> 
> On 9 Jul, 2013, at 14:56, Kevin Walzer <kw at codebykevin.com> wrote:
> 
> > On 7/9/13 5:46 AM, Paul Wiseman wrote:
> >
> >> But would anyone know if it would be possible to implement these
> >> platform specific bits whilst using PySide, using ctypes / pyobjc etc?
> >> (window animations, mac sheets etc.)
> >>
> >>
> >
> > This SO page has a few different examples of flipping windows in Cocoa:
> >
> > http://stackoverflow.com/questions/2490069/flipping-a-window-in-cocoa
> >
> > I have no idea how easy it is to call Objective-C using a C API like ctypes. Perhaps Ronald can weigh in on that.
> 
> Shouldn't be that hard, but I'd use PyObjC for that :-)
> 
> What I don't know is how much Qt would like you tweaking the window state like this, and if it even has methods to retrieve the native widgets that are backing the Qt ones (that is, can you even get the NSWindow* for a Qt window object?).
> 
> 
> It looks like you can get the native window handle which is promising: https://deptinfo-ensip.univ-poitiers.fr/ENS/pyside-docs/PySide/QtGui/QWidget.html#PySide.QtGui.PySide.QtGui.QWidget.winId
> 
> Is this handle enough to be able to mess with the window with PyObjC?

Converting this to PyObjC object with ``objc.objc_object(c_void_p=qwidget.winId())`` should then give you a Cocoa object (assuming Qt uses Cocoa by now and isn't stuck in Carbon land).

Ronald



More information about the Pythonmac-SIG mailing list