# PyGUI

# A
Graphical Application Framework
for
Python

by Greg Ewing

`greg.ewing@canterbury.ac.nz`

## Discussion

- Overview
- Terminology
- Event Handling
- Coordinates, Points and Rectangles
- Actions
- Menu Setup
- Using the View and ScrollableView classes
- Customising the Standard Menu Bar
- Resources
- Keyboard Navigation
- Printing
- Using PyGUI with Py2App and Py2Exe

## Tutorials

- BlobEdit

## Framework Classes

Classes making up the foundation of the model-view architecture and message handling system.

- class Application
- class Document
- class Window
- class Model
- class View
- class MessageHandler

## Abstract Classes

These classes define properties and methods that other PyGUI classes have in common. They are for internal use by the PyGUI framework only. You should not instantiate these classes or derive your own classes directly from them.

- class Component
- class Container
- class Control
- class ViewBase
- class ImageBase

## Window Classes

Components that appear as top-level windows on the desktop.

- class Window
- class Dialog
- class ModalDialog

## User-Defined View Classes

Components with drawing and input-handling methods that you can override.

- class View
- class ScrollableView
- class GridView
- class PaletteView

## Control Classes

Components for displaying and editing values.

- class Label
- class Button

- class DefaultButton
- class CancelButton

- class CheckBox
- class RadioButton
- class TextField
- class Slider

## Layout Classes

Components for arranging other components.

- class Frame
- class Row
- class Column
- class Grid

## Text Editing Classes

Components for displaying and editing text.

- class TextField
- class TextEditor

## Menu Classes

Classes for creating and manipulating menus and menu items.

- class Menu
- class MenuList
- class MenuItem

## Graphics Classes

Classes concerned with drawing 2D graphics in user-defined views.

- class Canvas
- class Color
- class Font
- class Image
- class Pixmap

## Support Classes

Non-graphical classes used behind the scenes.

- class Event
- class RadioGroup
- class FileRef
- class DirRef
- class FileType
- class Task
- class Cursor
- Exception classes

## OpenGL Classes

Classes concerned with 3D drawing using OpenGL.

- class GLConfig
- class GLView
- class GLPixmap
- class Texture
- class DisplayList
- class ShareGroup

## Printing Classes

Classes related to printing support.

- class PageSetup

## Functions

Stand-alone functions at the top level of the GUI package.

- Color functions
- application()
- run()

## Submodules

Functionality provided as submodules of the GUI package.

- StdColors - Predefined Color objects
- StdFonts - Predefined Font objects
- StdCursors - Predefined Cursor objects
- StdMenus - Constructing standard Menus and MenuBars
- Alerts - Various kinds of alert boxes
- FileDialogs - Dialogs for requesting old and new file and directory names
- Resources - Functions for finding and loading resources bundled with an application
- Geometry - Calculations with points and rectangles
- Printing - Classes and functions related to printing
- GL - OpenGL facilities
- Numerical - NumPy interface
- PIL - Python Imaging Library interface

## Example Code

- blobedit.py