TKinter in Python - advanced notions

Andreas Heckel akheckel at uni-bremen.de
Fri Jun 23 04:16:31 EDT 2023


Hi,

Apologies for potentially mis-using this thread. But I have been struggling recently making exactly this leap from simple GUI examples to a more elaborate MVVM concept. Mainly I have been struggling finding nice example python code bases, that allow some understanding to the beginner, which I certainly still am, but also show enough complexity to see the concept in action.
Any hints / links to github or similar highly welcome. If the list is not the appropriate place, I am happy if you email me directly.

Cheers,
Andreas

> -----Original Message-----
> From: Python-list 
> On Behalf Of Diego Souza via Python-list
> Sent: Friday, June 23, 2023 4:14 AM
> To: aapost 
> Cc: python-list
> Subject: Re: TKinter in Python - advanced notions
> 
> Have you considered improving the architecture itself, not your GUI library
> skills?
> 
> I recommend you look at the Model View ViewModel (MVVM) concept and
> implement something similar (this is largely used in the Android framework
> nowadays). This would separate your program logic from the rendering and
> visualization. It would also make your program more reactive, decoupled,
> and easier to maintain. When you mentioned threads I immediately thought of
> this because it is much easier to implement parallel jobs and present
> results back in the GUI, as everything becomes reactive. This is overkill
> for a small project such as the code you showed, but I recommend it for
> larger projects.
> 
> 
> 
> 
> 
> On Wed, Jun 21, 2023 at 7:20 PM aapost via Python-list <
> python-list at python.org> wrote:
> 
> > On 6/21/23 09:47, Dan Kolis wrote:
> > > I've write a huge biotech program ( an IDE for synthetic biology ), and
> > am slowly outgrowing TKINTER.
> > >
> > > Has anybody out there merged a little bit of TCL direct calls from
> > Python 3.X to get more freedom then TKINTER for just some Windows ?
> >
> > > I wish it looked better, but its 'ok'. I believe X11 IO is considerably
> > superior for serious work the HTML.  I mean 'serious' work. with lots of
> > multi media windows. I am not talking about fb "Oh ! There is a window it
> > opened inthe corner !"... trivial functionality.
> >
> >
> > I don't know if it would help, but you can extend/add tcl/tk packages
> >
> > I don't remember the full instructions right off, but quickly reverse
> > engineering my old stuff I think you just need to drop them in
> > /usr/share/tcltk/ or equivalent.
> >
> > (I needed to do that to replace the terrible looking default file dialog
> > for unix/linux with fsdialog.)
> >
> > then running something like the following from your Tk object
> >
> > self.eval('package require fsdialog')
> >
> > (reverse engineering the python tkinter source you can likely find other
> > ways of doing more tcl direct stuff)
> >
> > I have not researched if there are some better, more featured
> > (non-buggy) Text widgets implemented in tcl that can be dropped in, (I
> > know several of the tcl drop in widgets I tried were lacking in
> > refinement).
> >
> >  From what I can tell, once upon a time there were better, more
> > interesting projects and tutorials on extending tkinter, such as WCK
> > (tkinter3000), but the only remnants of those remain publicly available
> > are outdated unmaintained archives.
> >
> > You might also consider looking at the Grail browser source for research
> > purposes, as it does some interesting things with some of the widgets,
> > (parsing html and such), even though it is 20 years old now (and written
> > in python 1).
> > The update attempts from 10+ years ago have disappeared. (it's license
> > is considered questionable from what I understand, so not sure if that
> > is an aspect of it, the other being one of it's main features, python
> > applets, is unsafe and was not easily fixable)
> >
> > You might already be beyond some of these things though.
> >
> > I know what you mean as far is feeling like the little bit extra you
> > need pushes beyond what tkinter can do / makes you feel like you have
> > outgrown the module.
> >
> > (I had to take a break from one of my projects and send it to
> > development hell until my UI knowledge/skills improve after I found
> > myself considering using xml schema appinfo annotations to store json
> > formatted widget specific information, lol.)
> >
> > I have felt that sense of lack with most of the UI modules I have tried
> > though.
> >
> > I don't know of a clear better python-only solution though that fits my
> > personal needs.
> >
> > So I have to lean toward improving my tcl / C in hopes that it might
> > help steer me toward that extra (which seems to be in the spirit of what
> > tcl/tk's intent is to begin with). That will be a while for me though if
> > I get there.
> >
> >
> >
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> 
> 
> --
> Diego Souza
> Wespa Intelligent Systems
> Rio de Janeiro - Brasil
> --
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list