Discussion:
Phoenix - grid
Werner
2014-07-05 14:59:22 UTC
Permalink
Hi,

Doing test with Phoenix and Dabo I see a hard crash without any
traceback when "grid.HideCellEditControl()" is called.

Tried to modify the grid demo to recreate the crash, but no success to
this point.

Any tip on how I can further debug this?

I also note that the "Clone" method for custon GridCellEditor and
GridCellRenderer is never called, is that expected?

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Ross
2014-07-06 01:31:35 UTC
Permalink
Post by Werner
Hi,
Doing test with Phoenix and Dabo I see a hard crash without any
traceback when "grid.HideCellEditControl()" is called.
Tried to modify the grid demo to recreate the crash, but no success to
this point.
Any tip on how I can further debug this?
Disclaimer: Never tried Phoenix myself. Can be totally wrong.
Just looked at the source for the first time, all new and different.

Anyway, this may be relevant:

I was struggling with changes in wxGridCellEditorEvtHandler::OnKillFocus
while updating from 2.9.4 to 3.0.0:

http://trac.wxwidgets.org/changeset/73876

and that's related to

http://trac.wxwidgets.org/changeset/58969

"crashes which happen if the control receiving this event gets deleted
from it"
This was about 5 years ago.

This is the method in wxWidgets as used in 3.0.0:

void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
{
// We must let the native control have this event so in any case don't
mark
// it as handled, otherwise various weird problems can happen (see
#11681).
event.Skip();

// Don't disable the cell if we're just starting to edit it
if (m_inSetFocus)
return;

// Tell the grid to dismiss the control but don't do it immediately as
it
// could result in the editor being destroyed right now and a crash in
the
// code searching for the next event handler, so post an event asking
the
// grid to do it slightly later instead.

// FIXME-VC6: Once we drop support for VC6, we should use a simpler
// m_grid->CallAfter(&wxGrid::DisableCellEditControl) and
get
// rid of wxEVT_GRID_HIDE_EDITOR entirely.
m_grid->GetEventHandler()->
AddPendingEvent(wxCommandEvent(wxEVT_GRID_HIDE_EDITOR));
}

My guess: Editor is destroyed twice,
once by the native control destroying itself soon as it receives
OnKillFocus,
once by wxEVT_GRID_HIDE_EDITOR.
Post by Werner
I also note that the "Clone" method for custon GridCellEditor and
GridCellRenderer is never called, is that expected?
Werner
In my custom Editors in 2.9.4 and 3.0.0 this does not get called either.



Michael
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-07-08 08:22:38 UTC
Permalink
Hi,

I am running into another traceback when trying to get Dabo to work with
Phoenix.

File "D:\devTools\dabo - phoenix\ide\ReportDesigner.py", line 2582, in
<module>
form = ReportDesignerForm()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\form.py", line 1059, in
__init__
*args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\form.py", line 46, in __init__
attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\formmixin.py", line 77, in
__init__
attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 212, in
__init__
self._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\dockform.py", line 873, in
_afterInit
super(dDockForm, self)._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\form.py", line 64, in
_afterInit
super(BaseForm, self)._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\formmixin.py", line 129,
in _afterInit
super(dFormMixin, self)._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 342, in
_afterInit
self.afterInit()
File "D:\devTools\dabo - phoenix\ide\ReportDesigner.py", line 2361, in
afterInit
psP = PropSheetPanel(ps, Size=(200, 200))
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 275, in
__init__
attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 250, in
__init__
properties=properties, attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 40, in
__init__
properties=properties, attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 212, in
__init__
self._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 342, in
_afterInit
self.afterInit()
File "D:\devTools\dabo - phoenix\ide\ReportDesigner.py", line 648, in
afterInit
self.Editor = self.addObject(self.EditorClass)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 1068,
in addObject
obj = classRef(self, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 275, in
__init__
attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 250, in
__init__
properties=properties, attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\panel.py", line 40, in
__init__
properties=properties, attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 212, in
__init__
self._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 342, in
_afterInit
self.afterInit()
File "D:\devTools\dabo - phoenix\ide\ReportDesigner.py", line 823, in
afterInit
super(ReportPropSheet, self).afterInit()
File "D:\devTools\dabo - phoenix\ide\ClassDesignerPropSheet.py", line
30, in afterInit
self.propGrid = pg = PropertyGrid(ppg)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\grid.py", line 1940, in
__init__
attProperties=attProperties, *args, **kwargs)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\pemmixin.py", line 212, in
__init__
self._afterInit()
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\grid.py", line 2000, in
_afterInit
self._setTable(tbl)
File "D:\devTools\dabo - phoenix\dabo\ui\uiwx\grid.py", line 5224, in
_setTable
self.SetTable(tbl, True)
File "c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\grid.py",
line 46, in _Grid_SetTable
val = self._SetTable(table, takeOwnership, selmode)

wx._core.wxAssertionError: C++ assertion "uiIndex < m_nCount" failed at
C:\PROJECTS\buildbots\win7-py27\dist-win32-py27\wxWidgets\include\wx/dynarray.h(841)
in wxBaseArrayInt::Item():

The 'table' is an empty 'wx.grid.GridTableBase' at that point, is there
something not initialized or ...?

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...