|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#!/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;
This manual page details only those differences. For details on the API itself, see FVWM::Module.
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.
Good for diagnostics of a Tk based module.
Useful for notices by a Tk based module.
``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.
Scott Smedley <ss@aao.gov.au>.
Nick Ing-Simmons <Nick.Ing-Simmons@tiuk.ti.com> for Tk Perl extension.
Last modified on August 26, 2005