Home » Support » Index of All Documentation » How-Tos » How-Tos for GUI Development »

Using Wing IDE with GTK and PyGObject

Wing IDE is an integrated development environment that can be used to edit, test, and debug Python code that is written for GTK using PyGObject. Wing provides auto-completion, call tips, a powerful debugger, and many other features that help you write, navigate, and understand Python code.

For more information on Wing IDE see the product overview. If you do not already have Wing IDE installed, download a free trial now.

To get started using Wing, refer to the tutorial in the Help menu in Wing and/or the Wing IDE Quickstart Guide.

Auto-Completion

PyGObject uses lazy (on-demand) loading of functionality to speed up startup of applications that are based on it. This prevents Wing's analysis engine from inspecting PyGObject-wrapped APIs and thus the IDE fails to offer auto-completion.

To work around this, use Fakegir, which is a tool to build a fake Python package of PyGObject modules that can be placed onto the Source Analysis > Advanced > Interface File Path in preferences (add the parent directory of the generated modules you wish to import).

Fakegir's README.md provides usage details.

Don't add the Fakedir produced package to the Python Path defined in Wing's Project Properties because code will not work if the fake module is actually on sys.path when importing any PyGObject-provided modules.

Once this is done Wing should offer auto-completion for all PyGObject-provided modules and should be able to execute and debug your code without disruption.

Related Documents

Wing IDE provides many other options and tools. For more information:

Using Wing IDE with GTK and PyGObject