tkinter MVC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gigs_

    #1

    tkinter MVC

    Can someone give me example how to write text editor in tkintter with
    model-view-controler?
    What goes to controler and what goes to model?



    thanks in advance
  • Eric Brunel

    #2
    Re: tkinter MVC

    On Tue, 27 Mar 2007 13:29:25 +0200, Gigs_ <gigs@hi.t-com.hrwrote:
    Can someone give me example how to write text editor in tkintter with
    model-view-controler?
    What goes to controler and what goes to model?
    >
    thanks in advance
    Others may have a different opinion, but I think using MVC to do a text
    editor is a bit overkill. Basically, the only operation needed on the
    model are reading and writing of the file, so a basic Python file object
    will be OK. Considering that, and since the Tkinter Text widget is
    basically already a full-featured text editor, the controller part is also
    quite limited. You could do it however, but it would just be a matter of
    moving the methods called by the bindings to a secondary class. If what
    you're doing is just a text editor, it may not be worth the effort.

    Having an MVC architecture for a text editor may be a good idea if the
    file objects have to interact with other objects at a "functional " level,
    i.e without any impact on the GUI. If what you're doing is only a text
    editor, i.e only managing text files, the advantages of such an
    architecture won't really show up...

    My [$£€¥]0.02...
    --
    python -c "print ''.join([chr(154 - ord(c)) for c in
    'U(17zX(%,5.zmz 5(17l8(%,5.Z*(9 3-965$l7+-'])"

    Comment

    Working...