![]() |
|
This chapter describes how you can customize Wing IDE according to your needs.
![]() |
Wing may be customized in the following ways:
|
Wing has a set of preferences that control the basic layout of the user interface and affect features of the editor, debugger, source browser, and project manager. Although Wing will prompt you to select a few options the first time you run the IDE, it is likely that you will want to refine your preferences settings subsequently.
Default values for all preferences are set in the file
WINGHOME/preferences
. Individual users can override these by placing a
preferences file in the .wingide
subdirectory of their home directory
(on Linux) or WINGHOME\profiles\[username]
(on Windows), which are
created the first time Wing is run. The values given in the user-specific
preferences file take precedence over any values in the default
WINGHOME/preferences
file.
It is also possible to specify additional preferences files on the command
line though the --prefs-file
option. For example:
wing -prefs-file /path/to/myprefs
The individual preferences are documented in this chapter and the chapters that follow for each IDE subsystem.
![]() |
Note that setting a preference currently requires quitting and restarting Wing before the preference takes effect. |
The preferences file format consists of a sequence of lines, each of which
is a name=value
pair.
The name is in domain.preference form, where domain is the IDE
subsystem affected and preference is the name of the specific preference
(for example, edit.personality
defines the source editor's runtime
personality).
Preference values can be any Python expression that will evaluate to a
number, string, tuple, list, or dictionary. Additionally, the constants
true
and false
are defined and bound to 1 and 0,
respectively. Long lines may be continued by placing a backslash
(\\
) at the end of a line and comments may be placed anywhere on a
line by starting them with #
.
For security's sake values in a preferences file are evaluated in the context of a restricted execution space and cannot access the disk or network. See the Python Language Manual's RExec module for more information on these restrictions.
We ship Wing configured in a way we think will be most usable for the widest range of users. However, a range of options exist to users who want to alter the user interface to suit their needs.
The following preference can be used to alter windowing style in the graphical user interface:
true
to embed the command bar
within each source or manager window. Otherwise, a floating window
containing a single shared menu bar and toolbar is shown at the top of the
allocated screen area. Default=true
You can also change the screen area that will be used by Wing and how windows will be presented initially:
(10, 10, 1250, 930)
.
When set to None
, the full screen size is used. Default=None
(650, 1000)
.
When set to None
, a best guess based on screen size is made.
Default = None
(10, 10)
true
to stagger windows
rather than bringing up all new windows at the same location. Default=true
true
to remember
window positions so that documents and other windows are opened at using their last
position and size. Default=true
true
to include the toolbar in
windows displayed by Wing or false
to always hide the toolbar.
Default=true
true
to include the toolbar in
the source browser window or false
to exclude it from this window.
Default=false
true
to display tooltips
when the mouse cursor is above an enabled toolbar icon, or false
never to show tooltips. Caution: On Linux, tooltips have bugs that cause the GUI
to hang up under gtk versions less than 1.2.8. Do not enable this if you've
set Wing up to run with an older version of gtk. Default=true
.It is also possible to control which manager windows are visible at IDE startup, and whether or not the most recently open project file is reopened automatically:
true
to show the project
manager window at startup. Default=true
true
to show the source
code browser window at startup. Default=true
true
to show the debugger
window at startup. Default=false
true
to reopen the most recently
open project file at startup, if no other project file is given on the command line.
Default=true
Wing ships with a default editor personality that acts like a simple graphical text editor.
![]() |
The first thing any emacs user will want to do is to set the editor
personality to emulate emacs! This is done with the editor's personality
preference:
|
Additional information about the editor personalities can be found in sections 4.10 and 4.11 of the Source Code Editor chapter.
Wing ships with two key equivalency maps, both found in WINGHOME
:
keymap.normal
and keymap.emacs
. These are used as
default key maps for the corresponding editor personalities.
However, it is possible to copy these maps and customize them. If you do this, it is best to start with the mapping that most closely matches the editor personality you plan to use.
Key binding definitions in these files are in the form:
'key-sequence': 'ide-command'
The command portion of the key equivalency definition may be any of the
commands listed in this manuals in appendix A. The key sequence
is built from key names defined in WINGHOME/pygtk-0.6.5/GDK.py
starting
at line 300; the names are matched without regard to case. A single unmodified
key is specified by its name alone (for example, 'Down'
for the down
arrow key). Modified keys are specified by hyphenating the key names (for
example, 'shift-Down'
for the down arrow key pushed while shift is held
down). Multiple modifiers may also be specified, as in
'ctrl-shift-Down'
.
It is also possible to build multi-key combinations by listing multiple
key names separated by a space. For example, to define a key equivalent
that consists of first pushing ctrl-x and then pushing the a
key by itself, use 'ctrl-x a'
as the key sequence.
Wing may be set to use the customized key map file through the following preference:
''
Note that key bindings defined in your mapping will be shown in any menu items that implement the same command. This makes it easier to learn key bindings while using Wing.
It is also possible to customize the menu bar, although the way in which this is done requires that you have access to the source code, affects all users of a given Wing installation and will change in future versions of Wing.
To alter your menu bar, edit the file WINGHOME/guimgr/constants.py
and change the definition of the kMenuBarDefn constant. This constant is
described in a comment in the file.
Changes take effect when you restart Wing and caution is required as inserting a syntax error will prevent Wing from starting or may prevent menus from being available. Making a copy of the original file is strongly recommended.
The toolbar can also be altered using WINGHOME/guimgr/constants.py
by
editing the kToolbarDefn
constant. This also affects all users of a
given Wing installation and will change in future versions of Wing.
The toolbar icons are located in WINGHOME/guimgr/icons
. Making
a copy of the original constants.py
file is strongly recommended.
To enable or disable tooltips over the toolbar, set the gui.enable-tooltips
preference. The default is to disable tooltips on Linux because of problems with
gtk versions less than 1.2.8. On new Windows installations, the default is to enable
tooltips (because Wing is shipped with its own copy of gtk). If you have a user
preferences file on Windows from installation of version 1.1b3-3 or earlier,
you need to set this manually.
It is possible to have Wing's internal status messages appear in the terminal
window Wing was launched from by setting the
main.print-wing-debug-output
preference to true. The messages include
the location of Wing's library directory and any exceptions that may occur in
Wing's Python code. This option is useful when tracking down bugs in Wing
itself.
Some additional preferences are also available for controlling top-level behaviors:
{ 'linux': None, 'win32': None }
{ 'linux': None, 'win32': None }
true
, Wing will open
project files as text when they are opened from the File menu. Otherwise, any
file with .wpr
or .wpu
extension is opened as a project file
regardless from where it is opened. Default=false
10
"append-relative"
"*"
can be used to set
a generic viewer, such as a web browser. Use %s
to place the file name
on the command lines. On Windows, the system-wide configured default viewer
for the file type is used instead so this preference is ignored.
Default= { 'application/pdf':
[ 'acroread %s &', 'ghostview %s &' ],
'*':
[ "netscape -remote
'openFile(%s)'",
"netscape %s &" ], }
"*"
can be used to set
a generic viewer, such as a multi-protocol web browser. Use %s
to place
the URL on the command lines. On Windows, the system-wide configured
default web browser is used instead so this preference is ignored.
Default= { 'http':
[ "netscape -remote
'openURL(%s)'", "netscape %s &" ],
'*': [ "netscape -remote
'openURL(%s)'", "netscape %s &" ], }
false
the user is instead prompted for action. The user will be prompted for file names
for untitled files in all cases, even when this preference is set to true
.
Default=false
{ 'gif': 'image/gif' }
. Any value defined here will override
the Wing-defined defaults and any system-wide defaults. Default={}
{ 'image/mpmp': 'Multi-pixel moon phase image' }
. Names given here can also
be used to override the Wing-defined default names for files. Default={}
true
to use the
file selector that's native to your platform (for example, the Windows file
selector instead of the GTK selector). Default=true