# 以 Tk 打造圖形使用者介面 (Graphical User Interfaces)

Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers using the `tkinter` package, and its extension, the `tkinter.ttk` module.

`tkinter` 套件是 Tcl/Tk 之上的一個輕薄物件導向層。要使用 `tkinter`，你不需要編寫 Tcl 程式，但會需要查閱 Tk 文件和部份 Tcl 文件。`tkinter` 是一組將 Tk 小工具 (widget) 實作為 Python 類別的包裝器。

`tkinter` 的主要優點是速度快，而且通常與 Python 捆綁 (bundle) 在一起。儘管其標準文件不是很完整，但還是有些不錯的材料，包括：參考資料、教學、書籍等。`tkinter` 曾因其過時的外觀而眾所皆知，但這在 Tk 8.5 中得到了極大的改進。此外，還有許多其他你可能會感興趣的 GUI 函式庫。Python wiki 列出了幾個替代的 GUI 框架和工具。

- `tkinter` --- Tcl/Tk 的 Python 介面
  - Architecture
  - Tkinter Modules
  - Tkinter Life Preserver
    - A Hello World Program
    - Important Tk Concepts
    - Understanding How Tkinter Wraps Tcl/Tk
    - How do I...? What option does...?
    - Navigating the Tcl/Tk Reference Manual
  - Threading model
  - Handy Reference
    - Setting Options
    - The Packer
    - Packer Options
    - Coupling Widget Variables
    - The Window Manager
    - Tk Option Data Types
    - Bindings and Events
    - The index Parameter
    - Images
  - File Handlers
- `tkinter.colorchooser` --- 顏色選擇對話框
- `tkinter.font` --- Tkinter 字型包裝器
- Tkinter 對話框
  - `tkinter.simpledialog` --- 標準 Tkinter 輸入對話框
  - `tkinter.filedialog` --- File selection dialogs
    - Native Load/Save Dialogs
  - `tkinter.commondialog` --- Dialog window templates
- `tkinter.messagebox` --- Tkinter 訊息提示
- `tkinter.scrolledtext` --- 捲動文字小工具
- `tkinter.dnd` --- 拖放支援
- `tkinter.ttk` --- Tk 主題化小工具
  - 使用 Ttk
  - Ttk Widgets
  - Widget
    - 標準選項
    - Scrollable Widget Options
    - Label Options
    - 相容性選項
    - Widget States
    - ttk.Widget
  - Combobox
    - 選項
    - Virtual events
    - ttk.Combobox
  - Spinbox
    - 選項
    - Virtual events
    - ttk.Spinbox
  - Notebook
    - 選項
    - Tab Options
    - Tab Identifiers
    - 虛擬事件
    - ttk.Notebook
  - Progressbar
    - 選項
    - ttk.Progressbar
  - Separator
    - 選項
  - Sizegrip
    - Platform-specific notes
    - Bugs
  - Treeview
    - 選項
    - Item Options
    - Tag Options
    - Column Identifiers
    - 虛擬事件
    - ttk.Treeview
  - Ttk Styling
    - Layouts
- IDLE
  - 目錄
    - File menu (Shell and Editor)
    - Edit menu (Shell and Editor)
    - Format menu (Editor window only)
    - Run menu (Editor window only)
    - Shell menu (Shell window only)
    - Debug menu (Shell window only)
    - Options menu (Shell and Editor)
    - Window menu (Shell and Editor)
    - Help menu (Shell and Editor)
    - Context menus
  - Editing and Navigation
    - Editor windows
    - Key bindings
    - Automatic indentation
    - Search and Replace
    - Completions
    - Calltips
    - Code Context
    - Shell window
    - Text colors
  - Startup and Code Execution
    - 命令列用法
    - Startup failure
    - Running user code
    - User output in Shell
    - Developing tkinter applications
    - Running without a subprocess
  - Help and Preferences
    - Help sources
    - Setting preferences
    - IDLE on macOS
    - Extensions
  - idlelib