4 use lib
`fvwm-perllib dir`;
9 my $module = new FVWM
::Module
(
10 Name
=> "FvwmPerlBasedWinList",
11 Mask
=> M_WINDOW_NAME
| M_END_WINDOWLIST
,
12 EnableOptions
=> { "x" => \
$run_xmessage },
14 my $fh = $run_xmessage
15 ? new IO
::File
"| xmessage -geometry 240x300 -title 'Window List' -file -"
18 # Register the event handlers
19 $module->add_handler(M_WINDOW_NAME
, sub {
20 my ($self, $event) = @_;
21 printf $fh " 0x%07lx | %s\n", $event->_win_id, $event->_name;
24 # This one signals that the module should be terminated
25 $module->add_handler(M_END_WINDOWLIST
, sub {
26 print $fh "-----------+--------------------\n";
31 print $fh "-----------+--------------------\n";
32 print $fh " Window id | Name\n";
33 print $fh "-----------+--------------------\n";
35 # Ask fvwm to send us its list of windows
36 $module->send("Send_WindowList");