man -a Gtk2::Window |tee a.txt
Gtk2::Window(3) User Contributed Perl Documentation Gtk2::Window(3)
NAME
Gtk2::Window
DESCRIPTION
A Gtk2::Window is a top-level window displayed on the root window and interacting (or not) with the window manager. It can be an application's main window, a dialog, or a temporary such as a popup
splash window.
Delete Event and Destroy
The default action for a "delete-event" (normally from the window manager close button) is to destroy the window with "$window->destroy". In your main window you might want to exit the main loop
when that happens.
$toplevel->signal_connect (destroy => sub { Gtk2->main_quit });
If you install a handler for "delete-event" and return true, meaning "don't propagate", you can do something other than destroy the window. For example
$toplevel->signal_connect (delete_event => sub {
if (any_unsaved_documents()) {
popup_ask_save_before_exit_dialog();
return Gtk2::EVENT_STOP; # don't go to default destroy
} else {
return Gtk2::EVENT_PROPAGATE;
}
});
In a dialog or secondary app window you might not want to destroy but instead just hide ready for later re-use.
$dialog->signal_connect
(delete_event => \&Gtk2::Widget::hide_on_delete);
The choice between destroying or hiding is normally just a matter of memory saved against the time to re-create, and how likely the dialog might be needed again. (However if you build windows with
Glade it's not particularly easy to re-create them there, so you'll mostly want to just hide in that case.)
A hidden toplevel window is still in "Gtk2::Window->list_toplevels" and that's a good place to search for an existing window of a desired type to "$window->present" again.
HIERARCHY
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Window
下面通过使用以下bash脚本获取所有Gtk2组件的帮助手册信息:
for file in $(rpm -ql perl-Gtk2|grep "Gtk2::");
do
object=$(basename $file|sed 's/.3pm.gz//g');
man $object >>Gtk2_man.txt;
done
将txt转换为pdf后,文件如下:
Gtk2帮助手册.zip