Wxpython 简明教程

wxPython - Introduction

wxPython 是用于 wxWidgets (用 C++ 编写)的 Python 封装程序,而 wxWidgets 是一个流行的跨平台 GUI 工具包。由 Robin Dunn 和 Harri Pasanen 开发,wxPython 被实现为一个 Python 扩展模块。

wxPython is a Python wrapper for wxWidgets (which is written in C++), a popular cross-platform GUI toolkit. Developed by Robin Dunn along with Harri Pasanen, wxPython is implemented as a Python extension module.

就像 wxWidgets 一样,wxPython 也是一款免费软件。可从官方网站 http://wxpython.org. 下载。该网站上提供了适用于多种操作系统平台的二进制文件和源代码可供下载。

Just like wxWidgets, wxPython is also a free software. It can be downloaded from the official website http://wxpython.org. Binaries and source code for many operating system platforms are available for download on this site.

wxPython API 中的主要模块包含一个核心模块。该模块由 wxObject 类组成,它是 API 中所有类的基础。控件模块包含 GUI 应用程序开发中使用到的所有小部件。例如,wx.Button、wx.StaticText(类似于标签)、wx.TextCtrl(可编辑文本控件)等。

Principal modules in wxPython API include a core module. It consists of wxObject class, which is the base for all classes in the API. Control module contains all the widgets used in GUI application development. For example, wx.Button, wx.StaticText (analogous to a label), wx.TextCtrl (editable text control), etc.

wxPython API 具有 GDI(图形设备接口)模块。它是一组用于在小部件上绘制的类。字体、颜色、画笔等类都是它的组成部分。所有容器窗口类都在 Windows 模块中定义。

wxPython API has GDI (Graphics Device Interface) module. It is a set of classes used for drawing on widgets. Classes like font, color, brush, etc. are a part of it. All the container window classes are defined in Windows module.

wxPython 的官方网站还托管着 Project Phoenix - 一种为 Python 3.* 实现的 wxPython。它专注于提高速度、可维护性和可扩展性。该项目始于 2012 年,仍处于测试阶段。

Official website of wxPython also hosts Project Phoenix – a new implementation of wxPython for Python 3.*. It focuses on improving speed, maintainability, and extensibility. The project began in 2012 and is still in beta stage.