[wxPython] Consistency with naming of value setting/getting method of controls

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[wxPython] Consistency with naming of value setting/getting method of controls

Paul Sokolovsky-4
Hello wxpython-users,

  Browsing through wxWindows widget classes, following picture becomes
noticable: some of widgets, for example wxTextCtrl, have
GetValue()/SetValue() method pair for accessing widget's value. While
others, for example wxRadioBox, has
GetStringSelection()/SetStringSelection() for namely the same
operation. (GetSelection/SetSelection pair has other semantics -
accessing not by value but rather by internal index).

  Whether this inconsistency is big fault for original wxWindows with
it's C++ is arguable, but for such dynamic very high-level language it
certainly is. With consistent method naming, single loop/map may be
used to init/query whole dialog, etc. And further, it can be easily
fixed in wxPython by adding 'SetValue=SetStringSelection' at the
appropriate places in class definitions.

  I would like to know whether idea expressed here makes some sense
and if yes, I'd be happy to provide patch which adds this facility where
needed.




Best regards,
 Paul                          mailto:[hidden email]



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users




Loading...