[wxPython] A problem I've been running into for months...

Hi,

I first ran into a very similar problem to the following around a year ago.
Then and sense then, I've just tried a lot of modifications until my
program worked; unfortunately I can't remember exactly what those
modifications were! The problem's resurfaced recently, and I'm at my wit's
end again...

I have the following traceback:

Traceback (innermost last):
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 114, in
HandleTag
    return self.HandleWxpTag(tag)
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 170, in
HandleWxpTag
    self.ctx.kwargs)
  File "C:\WORK\AugerMate_p.6\src\HTMLDialog.py", line 950, in __init__
    Errors.InformationalMessagesWindow("%s.__init__: "
  File "C:\Program Files\Python\wxPython\controls.py", line 28, in __repr__
    return "<C wxControl instance at %s>" % (self.this,)
AttributeError: this

the first element of the tuple following the "%" after the string that
starts with in the above is just "self", an instance of a class derived
from wxGenButton... the <wxp> tag In key the wxHtmlWindow under question is

<wxp class="wxGenButtonWithKeyboardAccelerator" module="HTMLDialog">
    <param name="label" value="de&mo3">
    <param name="ID" value="502">
    <param name="style" value="wxNO_BORDER | wxWANTS_CHARS">
</wxp>

Anyone come across this sort of error before? It seems totally inexplicable
to me. Am I missing something obvious?

I guess I'll need to write a small program illustrating the error(in
particular including my class wxGenButtonWithKeyboardAccelerator!), but not
tonight! I just thought some kind person out there might have come across
something very similar and be able to save me some time...

Thanks for reading this, anyway...

Cheerio, Chris

···

-------------------------------------------------------------------------
Chris Fama <mailto:Chris.Fama@whollysnakes.com> Phone:(07) 3870 5639
Brisbane, Australia Mobile:(0400) 833 700
-------------------------------------------------------------------------

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

this is the "actual" pointer to the underlying object (this is a SWIG thing,
the object is actually a string if I recall correctly). The pointer is
created during the __init__ method of the base class from which you're
deriving. If you haven't yet called that method, "this" won't be there. To
get around the problem, you can set this = None in your class so that
instances that have failed to initialise will show up as "<C wxControl
instance at None>".

class X( wxFoo ):
  this = None
  def __init__( self, *args, **namedargs ):
    blargh()

Hope that helps,
Mike

···

-----Original Message-----
From: Chris Fama [mailto:Chris.Fama@uq.net.au]
Sent: Thursday, March 08, 2001 8:04 AM
To: Wxpython-Users
Subject: [wxPython] A problem I've been running into for months...

Hi,
...
I have the following traceback:

Traceback (innermost last):
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 114, in
HandleTag
    return self.HandleWxpTag(tag)
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 170, in
HandleWxpTag
    self.ctx.kwargs)
  File "C:\WORK\AugerMate_p.6\src\HTMLDialog.py", line 950, in __init__
    Errors.InformationalMessagesWindow("%s.__init__: "
  File "C:\Program Files\Python\wxPython\controls.py", line 28, in __repr__
    return "<C wxControl instance at %s>" % (self.this,)
AttributeError: this
...

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Yes, that solves my problem! Thank you VERY much...

Chris

···

-------------------------------------------------------------------------
Chris Fama <mailto:Chris.Fama@whollysnakes.com> Phone:(07) 3870 5639
Brisbane, Australia Mobile:(0400) 833 700
-------------------------------------------------------------------------

-----Original Message-----
From: wxpython-users-admin@lists.sourceforge.net
[mailto:wxpython-users-admin@lists.sourceforge.net]On Behalf Of Mike C.
Fletcher
Sent: Thursday, 8 March 2001 11:46 PM
To: wxpython-users@lists.sourceforge.net
Subject: RE: [wxPython] A problem I've been running into for months...

this is the "actual" pointer to the underlying object (this is a
SWIG thing,
the object is actually a string if I recall correctly). The pointer is
created during the __init__ method of the base class from which you're
deriving. If you haven't yet called that method, "this" won't be
there. To
get around the problem, you can set this = None in your class so that
instances that have failed to initialise will show up as "<C wxControl
instance at None>".

class X( wxFoo ):
  this = None
  def __init__( self, *args, **namedargs ):
    blargh()

Hope that helps,
Mike

-----Original Message-----
From: Chris Fama [mailto:Chris.Fama@uq.net.au]
Sent: Thursday, March 08, 2001 8:04 AM
To: Wxpython-Users
Subject: [wxPython] A problem I've been running into for months...

Hi,
...
I have the following traceback:

Traceback (innermost last):
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 114, in
HandleTag
    return self.HandleWxpTag(tag)
  File "C:\Program Files\Python\wxPython\lib\wxpTag.py", line 170, in
HandleWxpTag
    self.ctx.kwargs)
  File "C:\WORK\AugerMate_p.6\src\HTMLDialog.py", line 950, in __init__
    Errors.InformationalMessagesWindow("%s.__init__: "
  File "C:\Program Files\Python\wxPython\controls.py", line 28,
in __repr__
    return "<C wxControl instance at %s>" % (self.this,)
AttributeError: this
...

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users