[pygtk] PyGTK code structure

Jesus Rodriguez foxandxss at gmail.com
Sat May 16 06:47:52 WST 2009


Thanks you Gabriele Lanaro.

I know about kiwi and pygtkmvc, but I trust people's opinions more.

The way that you structure your code, is the MVP pattern, but PyGTK is
different from WPF, so there are some differences.

MVP is:

The mainView with the mainPresenter (your MainController),  the
MainPresenter talks with the model. There are some UserControls (like your
subviews) with their own Controllers that talk to the MainPresenter.

It is the same thing :P

Where did you learn that? The way you structure your code is better than the
way that many friends of mine code :P

2009/5/16 Gabriele Lanaro <gabriele.lanaro at gmail.com>

> I'm not a programmer in real life (I'm a student of chemistry) so, don't
> listen to me too much :)
> I found myself very well with the mvc pattern (hand maded) in pygtk, but
> there are 2 frameworks for this pattern, if you are interested:
> http://apps.sourceforge.net/trac/pygtkmvc/wiki
> gtkmvc has also nice tutorials, even if I don't use it, I found its
> documentation really useful.
> there is also kiwi:
> https://launchpad.net/kiwi
> but I don't know it.
>
> Personally, I organize my code in this way:
> I take two big classes, MainController and MainView,
> and other classes (various models), that have their events.
> The two big classes are splitted in subcontrollers and subviews, possibly
> the subviews are splitted in
> * input views (with the relative subcontroller attached)
> *merely display subviews(connected with the models)
> The controllers simply modifies the models and automatically all the views
> are updated.
>
>
>
> On Sat, 16 May 2009 00:19:49 +0200
> Jesus Rodriguez <foxandxss at gmail.com> wrote:
>
> > Hello there :)
> >
> > I have a little question about PyGTK programming. I am a Windows
> developer
> > using .NET. Well, I Use MVP (a MVC variation) for the code structure,
> that
> > is, for separating the view from the business logic using an intermediate
> > presenter (a kind of controller).
> >
> > I remember that many years ago, PyGTK wasn't MVC friendly. ¿What is it
> like
> > now?
> >
> > How do you people make the code structure of your PyGTK application?
> >
> > I remember that my PyGTK was hell :P
> >
> >
> > Thanks in advance for your help.
> >
>
>
> --
> Gabriele Lanaro <gabriele.lanaro at gmail.com>
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090516/f553de21/attachment.htm 


More information about the pygtk mailing list