wxPython question: wxChoice object wrongheaded?

Steve Holden sholden at bellatlantic.net
Thu Mar 9 07:10:17 CET 2000


Well, I'm just getting into wxPython: all Gerrit's hard work comparing
GUI systems for Python tickled my interest, and I have to say I never
found Tkinter that appealing.

The documentation appears to be a little sparse and mostly relates to
the C++ base implementation, so I've actually improved my C++ knowledge
a bit in building my first real-world application.  If anyone knows of
more specifically Python docs I'll be happy to know about them.  Save
me from writing a book ... :-)

I tried creating a wxChoice (Windows drop-down) object assuming that
size and position would be optional arguments, and was surprised to
see:

Traceback (innermost last):
  [yada yada yada]
  File "TaskRecord.py", line 43, in MakeBox
    self.PrjChoice = wxChoice(self, PROJECT, ProjectList)
  File "c:\program files\python\wxPython\controls.py", line 167, in __init__
    self.this = apply(controlsc.new_wxChoice,_args,_kwargs)
TypeError: Expected a 2-tuple of integers or a wxPoint object.

When I change the offending line 43 to

    self.PrjChoice = wxChoice(self, PROJECT,
                              wxPoint(0,20), wxSize(-1,-1), ProjectList)

the program runs correctly.  The position and size don't actually seem to
be actioned.  In the C++ documentation the pos and size parameters are
also required.  Anyone explain the logic here, or is this a feature?

Sorry if this isn't the best list for the question, but I know it
to be helpful and supportive even for (slightly?) off-topic posts.

regards
 Steve
--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list