Tkinter

Installing: sudo apt install python-tk sudo apt install python3-tk

Importing:

Importing as per PEP8:

Or bit more typing:

Listbox
Defining Listbox: listbox = Listbox(root, height=30, width=100) listbox.xview_scroll(3, "pages") listbox.yview_scroll(3, "pages") listbox.grid(row=7, columnspan=3)

Inserting output: listbox.insert(END, "1st Entry")

Deleting Output: listbox.delete(0, END)

Auto-scrolling Scrollbar:

Toplevel
Method to create Child Windows:

Cursors

 * Over Buttons:


 * For Root Window when busy:

MessageBox
To show a message box using Tkinter, you can use messagebox library like this:


 * Showinfo:


 * Warn or Error:


 * Askquestion dialogs:


 * Example for a message box when the user clicks a button:

SpinBox
To create a Spinbox widget, you can use Spinbox class like this:

spin = Spinbox(window, from_=0, to=100) spin = Spinbox(window, from_=0, to=100, width=5)

Complete example:

Menu Bar
To add a menu bar, you can use menu class like this:

Notebook widget (tab control)
To create a tab control follow these steps:


 * 1) Create a tab control using Notebook class
 * 2) Create a tab using Frame class.
 * 3) Add that tab to the tab control.
 * 4) Pack the tab control so it becomes visible in the window.

Add widgets to Notebooks
After creating tabs, you can put widgets inside these tabs by assigning the parent property to the desired tab.