newbie question: Document/View classes

Hi all,

I am new to wxPython. Can anyone point me to an example of Document/View classes in wxPython if they are available. tia.

Philip

There is a statement in the wxWindows documentation that it implements the
MVC paradigm. Because the MVC acronym is used so often I looked up how its
really supposed to work in the original Smalltalk meaning. There I found,
that view objects are made "dependent" on there models and the models have
only to send a changed message to themselves to get their view updated at
the next convenient time. Is there a possibility in wxPython to use such a
dependency mechanism?

Torsten

Philip Yue wrote:

Hi all,

I am new to wxPython. Can anyone point me to an example of
Document/View classes in wxPython if they are available. tia.

The wx doc/view classes are not in wxPython because I felt that it could
be better done directly in Python rather than wrapping the C++ classes.
The C++ implementation relies heavily on overriding virtual methods and
in order to allow that in Python I have to add a lot of overhead to the
wrappers.

On a related note, I have received a sneak-peek of a Python-only
reimplementation of the wx doc/view classes, but it is not complete yet.
Also, there is a C++ reimplementation that uses events rather than
virtuals, but I havn't looked at that one yet.

···

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

Torsten Sadowski wrote:

There is a statement in the wxWindows documentation that it implements the
MVC paradigm. Because the MVC acronym is used so often I looked up how its
really supposed to work in the original Smalltalk meaning. There I found,
that view objects are made "dependent" on there models and the models have
only to send a changed message to themselves to get their view updated at
the next convenient time. Is there a possibility in wxPython to use such a
dependency mechanism?

Something similar to MVC is used in the wxGrid classes, but that is really the only place currently. It wouldn't be hard though to create a MVC-like framework within your own app that uses wxPython classes for the views.

···

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

This brings up a related question I've had: if I were to contribute an
addition to wxPython, is it preferred to implement it in C++ in
wxWindows vs. submitting a wxPython implementation? Most of the time
implementation is easier and cleaner in wxPython, but the drawback is
that users of C++ or other bindings won't benefit from it.

···

On Mon, Jul 14, 2003 at 08:21:42AM -0700, Robin Dunn wrote:

On a related note, I have received a sneak-peek of a Python-only
reimplementation of the wx doc/view classes, but it is not complete
yet.

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

Tim Lesher wrote:

···

On Mon, Jul 14, 2003 at 08:21:42AM -0700, Robin Dunn wrote:

On a related note, I have received a sneak-peek of a Python-only
reimplementation of the wx doc/view classes, but it is not complete
yet.

This brings up a related question I've had: if I were to contribute an
addition to wxPython, is it preferred to implement it in C++ in
wxWindows vs. submitting a wxPython implementation? Most of the time
implementation is easier and cleaner in wxPython, but the drawback is
that users of C++ or other bindings won't benefit from it.

My guess is that you should implement it however is easist and quickest. Otherwise, there's a greater risk you might get too busy and not finish it at all. If it proves useful, then you or someone else could re-implement it in C++ for wxWindows, using the wxPython implementation as a prototype.

David

David C. Fox wrote:

Tim Lesher wrote:

On a related note, I have received a sneak-peek of a Python-only
reimplementation of the wx doc/view classes, but it is not complete
yet.

This brings up a related question I've had: if I were to contribute an
addition to wxPython, is it preferred to implement it in C++ in
wxWindows vs. submitting a wxPython implementation? Most of the time
implementation is easier and cleaner in wxPython, but the drawback is
that users of C++ or other bindings won't benefit from it.

My guess is that you should implement it however is easist and quickest. Otherwise, there's a greater risk you might get too busy and not finish it at all. If it proves useful, then you or someone else could re-implement it in C++ for wxWindows, using the wxPython implementation as a prototype.

Yep. There have been a few things that started life as Python classes and then got ported back to C++. Sizers is one of them. But unless performance is an issue then there is no reason not to do it in Python if that is where you need to use it.

···

On Mon, Jul 14, 2003 at 08:21:42AM -0700, Robin Dunn wrote:

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

Hi all,

Has anybody used validators with wxWizard? Please let me know how you
solved it.

Thanks,

Susanne

Hi all,

Has anybody used validators with wxWizard? Please let me know how you solved it.

Thanks,

Susanne

I figured it out. By calling page.Validate() in the
EVT_WIZARD_PAGE_CHANGING method I can do event.Veto() when the values are
incorrect.

/Susanne

···

On Tue, 15 Jul 2003, Susanne Lefvert wrote:

Hi all,

Has anybody used validators with wxWizard? Please let me know how you solved it.

Thanks,

Susanne

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

You don't even need to call your self the Validate method since the wxWizard
object will call it for you on the current page before any page change or
wizard finish. In the case a validator tells that data are invalid, the page
change or wizard finish is not performed.

Tip : If the controls on your wizard pages are owned by a panel window,
ensure that the wxWS_EX_VALIDATE_RECURSIVELY flag is set for that panel. If
not, no validation will occure for the controls owned by the panel.

Guillaume Brocker

-----Message d'origine-----

···

De : Susanne Lefvert [mailto:lefvert@mcs.anl.gov]
Envoye : mercredi 16 juillet 2003 20:26
A : wxPython-users@lists.wxwindows.org
Objet : Re: [wxPython-users] wxWizard and Validators

I figured it out. By calling page.Validate() in the
EVT_WIZARD_PAGE_CHANGING method I can do event.Veto() when the values are
incorrect.

/Susanne

On Tue, 15 Jul 2003, Susanne Lefvert wrote:

Hi all,

Has anybody used validators with wxWizard? Please let me know how you

solved it.

Thanks,

Susanne

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org