Carl Godkin
2014-03-03 23:08:45 UTC
Hi,
After upgrading some code that uses wxGrid to wx 3.0, I've started to see
asserts that say, "any pushed event handlers must have been removed"
when the application exits.
I've read some other messages to this list and understand that (as of wx 3)
there's now
an assert if PushEventHandler() calls are not matched by PopEventHandler()
calls.
However, our code is not calling PushEventHandler(). The only such call is
from wxScrollHelperBase::DoSetTargetWindow().
The assert is coming from a wxCheckBox that is apparently connected with a
wxGridCellBoolEditor
that I am using.
I'm setting it up like this:
m_attr = new wxGridCellAttr;
m_attr->SetEditor (new wxGridCellBoolEditor);
If I use this "bool editor," then I see an assert on exit from a wxCheckBox
destructor.
I have been able to prevent this by adding calls to PopEventHandler() for
the control associated
with the wxGridCellBoolEditor like this:
wxGridCellEditor *gcbe = m_attr->GetEditor(0, 0, 0);
if (gcbe && gcbe->GetControl())
gcbe->GetControl()->PopEventHandler ();
I'm not sure why my workaround is required. Do you have any suggestions as
to what
I should do differently to avoid this?
Thanks very much,
carl
After upgrading some code that uses wxGrid to wx 3.0, I've started to see
asserts that say, "any pushed event handlers must have been removed"
when the application exits.
I've read some other messages to this list and understand that (as of wx 3)
there's now
an assert if PushEventHandler() calls are not matched by PopEventHandler()
calls.
However, our code is not calling PushEventHandler(). The only such call is
from wxScrollHelperBase::DoSetTargetWindow().
The assert is coming from a wxCheckBox that is apparently connected with a
wxGridCellBoolEditor
that I am using.
I'm setting it up like this:
m_attr = new wxGridCellAttr;
m_attr->SetEditor (new wxGridCellBoolEditor);
If I use this "bool editor," then I see an assert on exit from a wxCheckBox
destructor.
I have been able to prevent this by adding calls to PopEventHandler() for
the control associated
with the wxGridCellBoolEditor like this:
wxGridCellEditor *gcbe = m_attr->GetEditor(0, 0, 0);
if (gcbe && gcbe->GetControl())
gcbe->GetControl()->PopEventHandler ();
I'm not sure why my workaround is required. Do you have any suggestions as
to what
I should do differently to avoid this?
Thanks very much,
carl
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users