crash when setting a parent window from a wx handle on osx

Bug #273608 reported by Hypnos
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Won't Fix
David Rose

Bug Description

When grabbing a handle from a wxPython window using GetHandle() and passing that in Panda's WindowProperties.setParentWindow method, a crash occurs.

Crash information is available at this forum thread:

Tags: carbon macos wx
rdb (rdb)
summary: - panda3d osx wxwindows crash
+ crash when setting a parent window from a wx handle on osx
description: updated
tags: added: wx
Changed in panda3d:
importance: Undecided → High
status: New → Confirmed
Changed in panda3d:
assignee: nobody → David Rose (droklaunchpad)
Revision history for this message
Craig Macomber (craigm) wrote :

I don't see a crash, but I get 2 separate windows (the attempt to set the handle does nothing). Tested on OSX 10.5 and 10.6 with panda 1.7.2. It works properly under windows7.

Here is some simple code that shows the issue:
import direct.directbase.DirectStart
from direct.task import Task
import wx
from panda3d.core import WindowProperties

app = wx.PySimpleApp()
def handleWxEvents(task=None):
    while app.Pending(): app.Dispatch()
    return Task.cont

taskMgr.add(handleWxEvents, 'handleWxEvents')

frame = wx.Frame(None, -1, 'My wx frame')
base.windowType = 'onscreen'
props = WindowProperties.getDefault()
base.openDefaultWindow(props = props)


Revision history for this message
rdb (rdb) wrote :

I don't think that it's even possible to support window reparenting under OSX through the Carbon interface. We'd probably need to rewrite the whole thing to Cocoa, which is not easy (and brings tons of other difficulties with it).

Revision history for this message
rdb (rdb) wrote :

In the meantime, we have Cocoa support in Panda3D, which resolves this issue. It does require a Cocoa version of wx to work, though. It is theoretically possible to reparent Cocoa views to a Carbon window by creating a HICocoaView embedding Panda's NSView, but I'm not sure that it's worth the effort given that Carbon is being phased out everywhere.

rdb (rdb)
tags: added: macos
removed: osx
Revision history for this message
rdb (rdb) wrote :

Setting to Won't Fix since Carbon support will be dropped soon.

tags: added: carbon
Changed in panda3d:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.