PacktLib: wxPython 2.8 Application Development Cookbook

wxPython 2.8 Application Development Cookbook


About the Author

About the Reviewers


Getting Started with wxPython


The application object

The main frame

Understanding the window hierarchy

Referencing controls

Using Bitmaps

Adding icons to Windows

Utilizing Stock IDs

Accessing the clipboard

Supporting drag and drop

Two-stage widget creation

Understanding inheritance limitations

Responding to Events


Handling events

Understanding event propagation

Handling Key events

Using UpdateUI events

Playing with the mouse

Creating custom event classes

Managing event handlers with EventStack

Validating input with validators

Handling Apple events

Basic Building Blocks of a User Interface


Creating Stock Buttons

Buttons, buttons, and more buttons

Offering options with CheckBoxes

Using the TextCtrl

Providing choices with the Choice control

Adding Menus and MenuBars

Working with ToolBars

How to use PopupMenus

Grouping controls with a StaticBox

Advanced Building Blocks of a User Interface


Listing data with a ListCtrl

Browsing files with the CustomTreeCtrl

Creating a VListBox

StyledTextCtrl using lexers

Working with tray icons

Adding tabs to a Notebook

Using the FlatNotebook

Scrolling with a ScrolledPanel

Simplifying the FoldPanelBar

Providing Information and Alerting Users


Showing a MessageBox

Providing help with ToolTips

Using SuperToolTips

Displaying a BalloonTip

Creating a custom SplashScreen

Showing task progress with the Progress dialog

Creating an AboutBox

Retrieving Information from Users


Selecting files with a FileDialog

Searching text with a FindReplaceDialog

Getting images with ImageDialog

Using the Print dialogs

Window Layout and Design


Using a BoxSizer

Understanding proportions, flags, and borders

Laying out controls with the GridBagSizer

Standard dialog button layout

Using XML resources

Making a custom resource handler

Using the AuiFrameManager

Drawing to the Screen


Screen drawing

Drawing shapes

Utilizing SystemSettings

Using a GraphicsContext

Drawing with RendererNative

Reducing flicker in drawing routines

Design Approaches and Techniques


Creating Singletons

Implementing an observer pattern

Strategy pattern

Model View Controller

Using mixin classes

Using decorators

Creating Components and Extending Functionality


Customizing the ArtProvider

Adding controls to a StatusBar

Making a tool window

Creating a SearchBar

Working with ListCtrl mixins

StyledTextCtrl custom highlighting

Creating a custom control

Using Threads and Timers to Create Responsive Interfaces


Non-Blocking GUI

Understanding thread safety

Threading tools

Using Timers

Capturing output

Building and Managing Applications for Distribution


Working with StandardPaths

Persisting the state of the UI

Using the SingleInstanceChecker

Exception handling

Optimizing for OS X

Supporting internationalization

Distributing an application