|
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/Unix) 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 graphical user interface can run in several modes, controlling how the menu bar and toolbar are presented, and how many windows are used to display source files and managers like the debugger and source code browser.
These modes are set using the following preference:
true
to open a new window
for each source code document that is opened. Otherwise, windows are
reused unless explicitely created. In this case a window may contain several
documents, of which only one is visible at any given time. Default=false
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/Unix, 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.12 and 4.13 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.
It is possible to run Wing IDE in such a way that prints debug output for Wing IDE and the debug machinery itself. If you are having problems with Wing or cannot get debugging working, this may reveal some information that will help in working with Technical Support.
On Windows, do this by executing console_wing.exe
instead of
wing.exe
. In this case, Wing will open a new console window where debug
output will be displayed.
On Linux/Unix, pass --verbose
as the first command line argument to
wing
. Here, debug output will be printed to the shell window from which
you launched Wing.
Whether or not you enable debug output, Wing always logs debug information to
a periodically truncated file called error-log
, which is placed in your
Wing configuration directory. On Linux/Unix, this is ~/.wingide
. On Windows,
it is profiles/USERNAME
below your Wing IDE installation directory.
USERNAME
is replaced with the user name under which you are logged in.
Similar debug output for diagnosing problems in the debugger internals is
controlled seperately by setting the debug.verbose
preference to
true
, and/or by setting debug.logfile
preference to a non-None
value (however, the specified file must exist or logging will be disabled).
When using wingdbstub
logging of debugger internals is controlled by
setting kSilent
to 0
or by setting WINGDB_SILENT
environment variable. Similarly, kLogFile
or WINGDB_LOGFILE
environment variable can be used to direct internal logging to a disk file.
Again, the disk file must already exist or logging is disabled.
Although Wing IDE and the debug program run in seperate processes, it is
acceptible to direct the debug process' internal logging into Wing's
error-log
file. This produces a single chronological combined
log, which can be sent to Archaeopteryx Technical Support.
Some additional preferences are also available for controlling top-level behaviors:
{ 'posix': None, 'win32': None }
{ 'posix': 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. If unspecified then Wing will use the configured URL
viewer in the environment (specified by BROWSER
environment variable or
by searching the path for common browsers). On Windows, the system-wide configured default viewer
for the file type is always used instead so this preference is ignored.
Example= { 'application/pdf':
[ "acroread '%s' &", "ghostview '%s' &" ],
'image/jpeg':
[ "gimp '%s' &" ],
'*':
[ "netscape -remote
'openFile(%s)'",
"netscape '%s' &" ], }
Default=
"*"
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. If unspecified, Wing will use the configured
URL viewer in the environment (specified by
verb!BROWSER! environment variable or by searching the path for common browsers).
On Windows, the system-wide configured
default web browser is always used instead so this preference is ignored.
Example= { 'http':
[ "xterm -e lynx '%s' &" ],
'*':
[ "netscape -remote
'openURL(%s)'", "netscape '%s' &" ], }
Default=
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
false
the user is prompted for action if
gui.auto-save-before-action
is false
or there are untitled
files. When set to true
, unsaved files are left unsaved and the action
simply starts. Warning: Setting this preference to true
may result in
debugging or executing source code that does not match what is displayed in
Wing's source editor windows. Default=false
true
3.0
{ '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
WINGHOME\profiles\[username]\error-log
on Windows and
~/.wingide/error-log
on Linux/Unix. Default=100000