Nictk 2.1.0
An easy to use pyton GUI
Nictk

Nictk (formerly Ntk) is a wrapper for tkinter written by Nicola Cassetta with the aim of simplifying its use for building graphical interfaces with Python.

As is known, tkinter is the Python standard library already included in the language distribution; it derives from Tcl/Tk and maintains its nomenclature and conventions in names and parameters of the functions, so they are often difficult to remember. It also has three different geometry managers (pack, grid and place) for placing widgets, which can be confusing. One of the most popular features is its ability to easily resize widgets when the main window is resized, but this often leads to strange behavior. For example, the standard behavior of an Entry object (the text field widget) is to grow larger as we type text into it. If we packed other widgets to its right all of them will move. Another problem arises for widget dimensions, which are in pixel for some of them (for example Button, Canvas) and in charachters for other (Label, Entry).

These things make tkinter not very easy to learn for people starting out in designing graphical interfaces with Python. So I tried to simplify these problems by adopting some general principles:

  • All widgets have a similar constructor, which enable the user to easily position them, with sizes always specified in pixels (as in tkinter, widgets can change their position and size when the main window is resized).
  • Many options for the widget config() method have been renamed in a way that is easier to remember, and some of them have been replaced by dedicated methods. Also the almost infinite series of winfo_... methods have been packed into the unique get_winfo() method, with a string parameter.
  • I renamed also some functions, trying to mantain the xxxx_yyyy scheme recommended in PEP 8 (this, however, is not complete).
  • I simplified the binding of events to callback functions, introducing in many widgets a command parameter in the constructor and standardizing the callback paradigm.
  • I simplified also the use of IntVar, StringVar, etc.

You can start learning Nictk by reading the Overview section.