Saturday, February 29, 2020

Python-Tkinter Basics


Python-Tkinter Basics

  1. Why GUI?
    • In simple words to provide simple Graphical User Interface to end users.
  2. What is Tkinter
    • Tkinter is python interface for tk()
    • Tkinter first release was in 1991
  3. Why Tkinter?
  4. Other packages?

Widgets:

  • button
  • canvas
  • checkbutton
  • combobox
  • entry
  • frame
  • label
  • labelframe
  • listbox
  • menu
  • menubutton
  • message
  • notebook
  • tk_optionMenu
  • panedwindow
  • progressbar
  • radiobutton
  • scale
  • scrollbar
  • separator
  • sizegrip
  • spinbox
  • text
  • treeview

Top-level windows:

  • tk_chooseColorpops : up a dialog box for the user to select a color.
  • tk_chooseDirectory : pops up a dialog box for the user to select a directory.
  • tk_dialog : creates a modal dialog and waits for a response.
  • tk_getOpenFile : pops up a dialog box for the user to select a file to open.
  • tk_getSaveFile : pops up a dialog box for the user to select a file to save.
  • tk_messageBox : pops up a message window and waits for a user response.
  • tk_popup : posts a popup menu.
  • toplevel : creates and manipulates toplevel widgets.

Geometry managers:

  1. place : which positions widgets at absolute locations
  2. grid : which arranges widgets in a grid
  3. pack : which packs widgets into a cavity

Package Installation

  • pip install tkinter

python class topic video