How to read filled-up form, created with wxDesigner?

Hello!

I am taking first steps on using wxPython and wxDesigner. I created one
simple dialog - form with several controls.

How can i read values from controls after user clicks "OK"? I tried to
use GetChildren() method and then iterate over resulting list to find
interesting controls by comparing known ID (set in wxDesigner) with
output of GetId() method of each list element. So far everything works
as expected, but when i try to use GetValue() method of list element i
get following error:

AttributeError: wxWindowPtr instance has no attribute 'GetValue'

Why is this wxWindowPtr instance instead of wxComboBox, which it should
be according to value returned by GetId()?

Is there any better method for reading controls?

My environment:
    Python: 2.1.3
    wxPython: 2.2.7
    OS: Debian Woody

···

--
Best regards
Ivar Zarans

Disregard my previous message - i have discovered wonderful world of
getters and wxPyTypeCast. :slight_smile:

···

On Thu, May 15, 2003 at 01:32:00AM +0300, Ivar Zarans wrote:

How can i read values from controls after user clicks "OK"? I tried to
use GetChildren() method and then iterate over resulting list to find

--
Bst regards,
Ivar Zarans

Ivar Zarans wrote:

AttributeError: wxWindowPtr instance has no attribute 'GetValue'

Why is this wxWindowPtr instance instead of wxComboBox, which it should
be according to value returned by GetId()?

Is there any better method for reading controls?

My environment:
    Python: 2.1.3
    wxPython: 2.2.7
    OS: Debian Woody

I see you've already discovered how to use wxDesigner to make the getters, but just as an FYI the newer releases of wxPython would probably have worked with your original code. The type of the C++ object is now used to contruct a Python object of the right type whenever needed, and most of the time the original python object is returned instead of just making a new proxy object to wrap the C++ object.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks! Seems like one more reason for upgrade. :slight_smile:

···

On Thu, May 15, 2003 at 10:27:06AM -0700, Robin Dunn wrote:

I see you've already discovered how to use wxDesigner to make the
getters, but just as an FYI the newer releases of wxPython would
probably have worked with your original code.

--
Best regards,
Ivar Zarans