[wxpython-users] Problem with GetTopLevelParent() (not working always)

Raffaello Barella barbarossa.platz at gmail.com
Tue Apr 1 22:28:25 PDT 2008


Impossible, Andrea. First, the problem occurs with a subclassed wx.grid with
more than 500 lines of code, and the bug might be everywhere. Second, this
four letter bug does not occur regularly, but only from time to time.
Sometimes to close and restart the application helps, a few days ago I had
to disinstall wxPython and reinstall it. The traceback just shows the
message I wrote, plus the line of code where the error occurred, and this is
not of much help.
My only hope is that this same thing happened to somebody more clever than
I.
Meanwhile, I bypassed the problem replacing GetTopLevelParent()  with
GetGrandParent(): the window so far seems to be able to recognize its
"nonno".
Thanks anyway.

2008/4/1, Andrea Gavana <andrea.gavana at gmail.com>:
>
> HI Raffaello,
>
>
> On Tue, Apr 1, 2008 at 3:34 PM, Raffaello Barella wrote:
> > Sorry, I do not understand. My problem is that sometimes -not always-
> the
> > message  =ABThe object has no attribute 'GetTopLevelParent'=BB comes fr=
om a
> > derived control (a wx.grid) that, as such, cannot exist without a parent
> > frame.
> >
> > 2008/4/1, Bob Klahn <bobstones at comcast.net>:
> > > At 02:56 AM 4/1/2008, Raffaello Barella wrote:
> > > >Working on Windows XP, it happens sometimes that
> > > >I get an AttributeError with GetTopLevelParent()
> > > >(the message is =ABThe object has no attribute 'GetTopLevelParent'=
=BB).
> > > >Any idea?
> > >
> > >
> > > You'll get that for any object that doesn't inherit from
> wx._core.Window.
> > >
> > > Bob
>
>
> I'd say we should see a small sample app that reproduces the problem
> to be able to drill down to the problem... as far as I know, all
> wx.Window derived classes have a GetTopLevelParent method, so I can't
> see why a wx.grid.Grid shouldn't have it. BTW, which is your exact
> traceback?
>
> Andrea.
>
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.alice.it/infinity77/
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200804=
02/f3840039/attachment.htm


More information about the wxpython-users mailing list