Home
Authors History
Donations Cats
News
News FVWM Logo
Logo Competition
Features
Features
Download
Download
Icons and Sounds
Screenshots
Desktop Screenshots Menu Screenshots
Window Decor Screenshots Vectorbuttons
Documentation
Documentation Man pages
FAQ Developer Info
Mailing Lists
Mailing Lists
Links
Links
Customize
 
 Official FVWM Home Page plain theme

FVWM - Perl library - FVWM::Module::Tk


FVWM::Module::Tk

Section: FVWM Perl library (3)
Updated: 2005-08-24
Source: FVWM/Module/Tk.pm
This page contents - Return to main index
 

NAME

FVWM::Module::Tk - FVWM::Module with the Tk widget library attached  

SYNOPSIS

Name this module TestModuleTk, make it executable and place in ModulePath:

    #!/usr/bin/perl -w

    use lib `fvwm-perllib dir`;
    use FVWM::Module::Tk;
    use Tk;  # preferably in this order

    my $top = new MainWindow(-name => "Simple Test");
    my $id = $top->wrapper->[0];

    my $module = new FVWM::Module::Tk(
        TopWindow => $top,
        Mask => M_ICONIFY | M_ERROR,  # Mask may be omitted
        Debug => 2,
    );
    $top->Button(
        -text => "Close", -command => sub { $top->destroy; }
    )->pack;

    $module->addDefaultErrorHandler;
    $module->addHandler(M_ICONIFY, sub {
        my $id0 = $_[1]->_win_id;
        $module->send("Iconify off", $id) if $id0 == $id;
    });
    $module->track('Scheduler')->schedule(60, sub {
        $module->showMessage("You run this module for 1 minute")
    });

    $module->send('Style "*imple Test" Sticky');
    $module->eventLoop;
 

DESCRIPTION

The FVWM::Module::Tk class is a sub-class of FVWM::Module::Toolkit that overloads the methods new, eventLoop, showMessage, showDebug and showError to manage Tk objects as well. It also adds new method topWindow.

This manual page details only those differences. For details on the API itself, see FVWM::Module.  

METHODS

Only overloaded or new methods are covered here:
new param-hash
$module = new FVWM::Module::Tk TopWindow => $top, %params

Create and return an object of the FVWM::Module::Tk class. This new method is identical to the (grand-)parent class method, with the exception that a Tk top-level of some sort (MainWindow, TopLevel, Frame, etc.) may be passed in the hash of options using the TopWindow named value. Other options in param-hash are the same as described in FVWM::Module.

If no top-level window is specified in the constructor, such dummy window is created and immediatelly withdrawn. This top-level window is needed to create Tk dialogs.

eventLoop
From outward appearances, this methods operates just as the parent eventLoop does. It is worth mentioning, however, that this version enters into the Tk MainLoop subroutine, ostensibly not to return.
showError msg [title]
This method creates a dialog box using the Tk widgets. The dialog has three buttons labeled ``Close'', ``Close All Errors'' and ``Exit Module''. Selecting the ``Close'' button closes the dialog. ``Close All Errors'' closes all error dialogs that may be open on the screen at that time. ``Exit Module'' terminates your entire module.

Good for diagnostics of a Tk based module.

showMessage msg [title]
Creates a message window with one ``Ok'' button.

Useful for notices by a Tk based module.

showDebug msg [title]
Creates a debug window with 3 buttons ``Close'', ``Clear'' and ``Save''. All debug messages are added to the debug window.

``Close'' withdraws the window until the next debug message arrives.

``Clear'' erases the current contents of the debug window.

``Save'' dumps the current contents of the debug window to the selected file.

Useful for debugging a Tk based module.

topWindow
Returns the Tk toplevel that this object was created with.
 

BUGS

Would not surprise me in the least.  

AUTHOR

Mikhael Goikhman <migo@homemail.com>.  

THANKS TO

Randy J. Ray <randy@byz.org>, author of the old classes X11::Fvwm and X11::Fvwm::Tk.

Scott Smedley <ss@aao.gov.au>.

Nick Ing-Simmons <Nick.Ing-Simmons@tiuk.ti.com> for Tk Perl extension.  

SEE ALSO

For more information, see fvwm, FVWM::Module and Tk.


 

Index

NAME
SYNOPSIS
DESCRIPTION
METHODS
BUGS
AUTHOR
THANKS TO
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 00:51:30 GMT, August 27, 2005

Last modified on August 26, 2005