TkPerlConsole - a console and debugging window implemented in Perl/Tk
TkPerlConsole can only be spawned by fvwm. No command-line invocation is possible.
TkPerlConsole is a sample application distributed with the X11::Fvwm
extension to Perl 5. It combines the functionality of the FvwmConsole and
FvwmDebug modules (from the extras directory of the Fvwm2 distribution) into one application.
When run, TkPerlConsole reads the configuration lines specified in the configuration file fvwm itself used. It specifically looks for options whose names begin with the
name of the application. You can link TkPerlConsole
under additional names to specify different sets of options.
TkPerlConsole can be invoked by fvwm during initialization by inserting the line 'Module
TkPerlConsole' in the .fvwmrc (or .fvwm2rc) file.
TkPerlConsole must reside in a directory that is listed in the
ModulePath option of Fvwm for it to be executed by Fvwm.
When spawned by Fvwm, TkPerlConsole will recognize these switches:
- -d
-
Turn on the packet debugger as well as the console window itself. Creates a
second display area above the console in which packet traffic from Fvwm is
summarized.
- -c
-
Send an initial Send_ConfigInfo message to Fvwm. Causes the start-up debug box to already contain all
configuration options for all modules. This has no visible effect unless -d is also specified.
- -w
-
Send an initial Send_WindowList message to Fvwm, causing the debug box to already contain a listing of all
windows currently managed by Fvwm. This has no visible effect unless -d is also specified.
TkPerlConsole recognizes the following list of options that it receives from the running
Fvwm process. Note that the leading part of the name is based on the
application name. Were the user to make a link to TkPerlConsole
under the name TransientWL (for calling as a transient application), then you would replace TkPerlConsole with TransientWL in all the names below:
The following detail specifying defaults to be used for classes of widgets.
Three characteristics are recognized: Font, Foreground and Background.
These are represented below by the symbol (CLASS). These are applied to the following set of widgets: Button, Label,
Listbox, Entry and Scrollbar. These are represented below by the symbol WIDGET. Thus, there are 15 possible expansions for the item below:
- TkPerlConsole(WIDGET)(CLASS)
Set the default value for CLASS as it should be applied to all widgets of type WIDGET. The value *TkPerlConsoleButtonFont will then set the font to be used on all buttons.
Note: The default font for all widgets except labels is fixed. Labels default to a larger, italic Helvetica. Using the above
specification is the only way to change the font for Label widgets. They
are not affected by the general-default font specification. Also note that
scrollbars have one extra element of note from the other widgets, the color
of the trough in which the scrollbar thumb sits:
Here is a sample configuration, used by the author and annotated here for
clarity:
# General application to all widgets
*TkPerlConsoleFont 9x15
*TkPerlConsoleForeground AntiqueWhite
*TkPerlConsoleBackground gray30
# Change the color of the label text
*TkPerlConsoleLabelForeground gold1
# The listboxes are the areas in which data from fvwm is displayed
*TkPerlConsoleListboxBackground NavyBlue
*TkPerlConsoleListboxForeground gold1
# Set the color of the back area of the scroll bars
*TkPerlConsoleScrollbarTroughColor AntiqueWhite
TkPerlConsole is meant primary as an example of coding with the X11::Fvwm
(see X11) module and the Tk module. While it can be useful, it is not supported to
the degree that the Fvwm module itself is.
It is also coded for clarity at the expense of efficiency.
Specifying widget characteristics by class is nice, but to truly emulate X
resources, it will have to allow specifications by given widget name as
well as class, and it doesn't (yet).
TkPerlConsole is copyright (c) 1997 by the author, all rights reserved. It may be copied
and distributed under the same terms as the X11::Fvwm
module itself. See the README file that was packaged with the distribution.
Randy J. Ray <randy@byz.org>, based on the code from
the fvwmperl
module by Dan Astoorian