|
FVWM::Module::Gtk2
Section: FVWM Perl library (3) Updated: 2005-08-24 Source: FVWM/Module/Gtk2.pm
This page contents
- Return to main index
NAME
FVWM::Module::Gtk2 - FVWM::Module with the GTK+ v2 widget library attached
SYNOPSIS
Name this module TestModuleGtk2, make it executable and place in ModulePath:
#!/usr/bin/perl -w
use lib `fvwm-perllib dir`;
use FVWM::Module::Gtk2;
use Gtk2 -init; # preferably in this order
my $module = new FVWM::Module::Gtk2(
Debug => 2,
);
my $dialog = new Gtk2::Dialog;
$dialog->signal_connect("destroy", sub { Gtk2->main_quit; });
$dialog->set_title("Simple Test");
my $button = new Gtk2::Button "Close";
$button->signal_connect("clicked", sub { $dialog->destroy; });
$dialog->action_area->pack_start($button, 1, 1, 0);
$dialog->show_all;
my $id = $dialog->window->XWINDOW();
$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 "Simple Test" Sticky');
$module->eventLoop;
DESCRIPTION
The FVWM::Module::Gtk2 class is a sub-class of FVWM::Module::Toolkit
that overloads the methods eventLoop, showError, showMessage and
showDebug to manage GTK+ version 2 objects as well.
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:
- eventLoop
-
From outward appearances, this methods operates just as the parent
eventLoop does. It is worth mentioning, however, that this version
enters into the Gtk2->main subroutine, ostensibly not to return.
- showError msg [title]
-
This method creates a dialog box using the GTK+ 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.
Useful for diagnostics of a GTK+ based module.
- showMessage msg [title]
-
Creates a message window with one ``Close'' button.
Useful for notices by a GTK+ based module.
- showDebug msg [title]
-
Creates a persistent debug window with 3 buttons ``Close'', ``Clear'' and ``Save''.
All new debug messages are added to this window (i.e. the existing debug
window is reused if found).
``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 GTK+ based module.
BUGS
Awaiting for your reporting.
AUTHOR
Mikhael Goikhman <migo@homemail.com>.
THANKS TO
gtk2-perl.sf.net team for Gtk2-Perl extension.
SEE ALSO
For more information, see fvwm, FVWM::Module and Gtk2.
See also FVWM::Module::Gtk for use with GTK+ version 1.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- METHODS
-
- BUGS
-
- AUTHOR
-
- THANKS TO
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 00:51:28 GMT, August 27, 2005
|