Hello all,
I’m writing a small program and I’ve been looking for an event driven programming framework to give it a GUI. I’ve played around with pyglet a bit in the past but since I’m looking to create a GUI that is controlled via widgets, I don’t think pyglet is the best fit.
Naturally I’ve been considering using the tkinter module, but to be honest I’m struggling to work out what Tk actually is. Like many such things any description of it is full of jargon and doesn’t really answer the simple question.
Am I right in thinking that Tk is just a library / libraries containing code that can obtain a window, render widgets to that window, monitor events related to the window and call routines defined in the user’s application in response to those events?
tkinter I understand is just a Python package that contains modules providing Python language bindings for the Tk framework.
It’s frustrating because the Tcl/Tk official site describes Tk as…
a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface in many programming languages
This is confusing for a few reasons; it says Tk provides “a library of basic elements of GUI widgets”, are the GUI widgets not the basic elements themselves? Either this is poor English or I’m not a programmer (at least one of these things is definitely true).
Secondly, if Tk does contain code that can obtain a window from the OS and render to it, plus code that constitutes an event monitor, it does more than just provide widgets. A directory of .jpeg files could be considered a library of widgets.
And finally, apart from being developed in tandem by the same core team, what does Tk have to do with Tcl in the context of Python? The Git Hub page for Tk shows it’s approximately 10% Tcl and roughly 85% C; does that mean it’s written in Tcl but leans heavily on a library of C functions?
I appreciate one doesn’t need to understand all this just to use tkinter but I’m finding it a bit confusing! Any info would be much appreciated