Nictk 2.2.0
An easy to use pyton GUI
Variable objects

Tkinter has special objects called control variables. They all inherit from the tkinter.Variable class (they are tkinter.IntVar, tkinter.DoubleVar, tkinter.StringVar and tkinter.BooleanVar) and behave like normal Python variables (we can write and read their value with the set() and get() methods), but they have some additional features:

For more details on these objects you can see the anzeljg reference.

This is a summary of how these variables are treated in Nictk:

Widget Notes Writing and reading
Nictk.Button, Nictk.Label You can set a StringVar in the content parameter of its constructor; this is shown as the widget label, and the widget will be updated if the variable changes. You can set or get the value both with the Nictk.Widget.set_content() and Nictk.Widget.get_content methods, or with the variable set() and get() methods
Nictk.Checkbutton You have two parameters in the constructor: in content you can set a StringVar which will control the button label, in variable you can set a variable of any kind and its values corrisponding to the on and off state. You can set and get the button label with the Nictk.Widget.set_content() and Nictk.Widget.get_content methods, and the button state (on/off) with Nictk.Checkbutton.set_value() and Nictk.Checkbutton.get_value() methods. Moreover you can use the variable set() and get() methods
Nictk.Entry You can set a StringVar in the variable parameter of its constructor; this will hold the entry text. As above.
Nictk.Combobox, Nictk.Spinbox You can set a StringVar in the variable parameter of its constructor; this will hold the selected item (numbers are converted into strings). As above
Nictk.Radiobutton You must assign all buttons of the same mutually exclusive group the same variable (of any type), giving each button a different value (in the constructor parameter variable. Pressing a button will assign the variable the value associated with the button, and turn off all the other buttons in the group. There are no widget methods, you must use the variable set() and get() methods
Nictk.Scale You can set a IntVar or DoubleVar in the variable parameter of its constructor; this will hold the widget selected value. You can set and get the selected value with Nictk.Scale.set_value() and Nictk.Scale.get_value(), or can use the variables set() and get() methods