Aside:
聽聽Wondering if it would be possible to provide a hook so that a wxAssert could trigger Python code (such as starting the debugger to see what call is causing the assert).
The particular trigger :
聽聽wincmn.cpp line 655,
聽聽聽聽聽wxASSERT_MSG( !GetChildren().Find(child), _T("AddChild() called twice") );
With a note above it stating it should never happen and will cause a crash if it does.
This is seen in a large application (room scheduler), and in the wxprop (with wxpycolours) demo using the wxColour chooser. Both cases involve the creation of a wxprop "transient dialog" (actually a frame), still working to track down where in that creation the error occurs (as you can see by my request above :o) ).
Note: the code work properly in preview release 3
Note: the text-control version of the transient frame works properly (doesn't cause an assert error)
I am assuming this is something to do with some change somewhere in the low-level wxPython support code. Alternately, there may be a problem with the use of the following function with new-grid code:
def findManagedParent( window ):
聽聽聽聽聽"""Find the nearest managed parent (dialog or frame) or NULL
聽聽聽聽聽if there is no managed parent available"""
聽聽聽聽聽current = window
聽聽聽聽聽while not (
聽聽聽聽聽聽聽聽聽isinstance(current, wxFramePtr) or
聽聽聽聽聽聽聽聽聽isinstance(current, wxDialogPtr) or
聽聽聽聽聽聽聽聽聽current == NULL or
聽聽聽聽聽聽聽聽聽current == None
聽聽聽聽聽):
聽聽聽聽聽聽聽聽聽current = current.GetParent()
聽聽聽聽聽return current
which allows the transient frames to be parented to the dialog/frame owning the grid, rather than the button/control in the grid cell (the "window" passed to findManagedParent). This doesn't seem likely, however, as the transient frame never uses the button as a parent... relevant code:
realParent = findManagedParent( parent )
self.buttonParent = weakref.ref( parent )
wxFrame.__init__( self, realParent, id, title, pos, size, style, name )
Anyone else getting this assert showing up, or should I be worried primarily about my own code?
Mike
路路路
_______________________________________
聽聽聽Mike C. Fletcher
聽聽聽http://members.rogers.com/mcfletch/