wxGlade Overview¶
Running wxGlade¶
Start: To run wxGlade, start the wxglade.py or wxglade.pyw program file with the Python interpreter.
Other Prerequisites: On Windows, the win32 extensions should be installed: https://sourceforge.net/projects/pywin32/ If they are available, wxGlade will register for .wxg files such that you can open them via double-click.
- Supported Python and wxPython Versions:
- The Classic wxPython versions 2.8 and 3.0 are supported as well as wxPython Phoenix running under Python 3
- Phoenix plus Python 2 will probably also work, but this is not tested at all. wxPython 2.8 is generally less tested than the more recent versions.
- When running Python 3 + Phoenix or Python 2 + Classic, the generated Python code will not be compatible to the other version.
Note
For the best user experience, run wxGlade with your target wxPython revision (i.e. 2.8 or 3.0). If you use a different revision, the Design and Preview window might not look identical to your final program, as some styles are not supported under all revisions.
Program Windows¶
wxGlade consists of five main windows:
(click on one of the images to see it full size)
See also
Reference: Keyboard and Mouse Actions for keyboard shortcuts and mouse actions.
Examples¶
Before doing anything else, you may want to open an example file showing most of the supported controls:
- for wxPython 3.0 and Phoenix:
examples/AllControls_30.wxg
- for wxPython 2.8:
examples/AllControls_28.wxg
Each example file includes a frame with most of the supported widgets and also a menu bar, a tool bar and a status bar.
- Required steps:
- open the file by dragging it to the main window or by selecting the menu item File->Open
- double-click “All_Widgets” in the Tree window to open the Design window and have a look around
- create Python source code:
- press
Ctrl-G
or - select the toplevel object “Application” and hit the button “Generate Source” in the Properties window
- press
- press
F5
to create a preview
More examples:
There are additional examples in wxglade/examples
showing how to use the CustomWidget to integrate some widgets that are not directly supported by wxGlade. The wxGlade design window will only display a placeholder for these.
html
: usewx.html.HtmlWindow
to display simple HTML pageshtml2
: usewx.html2.WebView
to display HTML with Javascript and CSS (not available on wxPython 2.8)lib_plot
: usewx.lib.plot.PlotCanvas
for plottingmatplotlib
: use a Matplotlib canvas for plotting, quick and dirty versionmatplotlib2
: use a Matplotlib canvas for plotting, better structuredmatplotlib3
: full Matplotlib embedding exampleSpeedMeter
: demonstratewx.lib.agw.speedmeter.SpeedMeter
py_shell
: show how to embed a Python shellwx.py.shell.Shell
Some of these are explained in Custom Widget, some have Readme.txt files.