Jim Rochelle wrote:
I'm new to wxpython. I see some ways of taking numerical user input
in the masked edit controls portion of the wxPython demo but I don't
see any example of how to actually take and manipulate the user input
for those data fields. Are there some simpler examples somewhere
that I'm missing?
I'm not sure what you're after here; could you be a little more
specific? As a general rule, it's good to review the wxPyWiki
(http://wiki.wxpython.org) to get examples; there's a "hello world"
there, as well as a lot of other good material on "getting started."
And for that matter, are masked edit controls the
best/only way to take user input?
wxMaskedTextCtrl is just one of a plethora of controls provided
by wxPython; it only figures prominently in the demo because it's
relatively new and Robin reserves a space for such things at the
top of the demo.
wxTextCtrl is a generic text input control; wxMaskedTextCtrl
provides a way to restrict what people can type in the controls;
it allows you to say "just digits allowed," for example, and allows
for fixed, noneditable characters within the control.
I would describe the basic model for wxPython as:
1) build your form,
2) optionally populate the controls with initial values,
3) on close of the form, or on a button press (like "convert"),
retrieve the values from the controls, typically with .GetValue(),
and do whatever action is required with that value.
The specific program I am working on is one to do English to
Metric to English conversions. Any help is greatly appreciated.
Thank you!
wxMaskedNumCtrl may be what you want. It's derived from
wxMaskedTextCtrl, but provides GetValue() and SetValue() methods
that take and return actual numeric types. It was recently
added (by me) as part of wxPython 2.4.2.2. It handles float
and integer values, and fixed precision.
(A small example of what you want to do might help people
show you how you would go about it.)
Regards,
/Will Sadkin
Parlance Corporation
www.nameconnector.com