Here's some interactive code for testing the window creation hook.
my $w = Gtk2::Window->new; my $nb = Gtk2::Notebook->new; $nb->append_page (my $c = Gtk2::Label->new ('Test')); $nb->set_tab_detachable ($c, TRUE);
Gtk2::Notebook->set_window_creation_hook ( sub { my ($notebook, $page, $x, $y, $data) = @_;
my $new_window = Gtk2::Window->new;
my $new_notebook = Gtk2::Notebook->new;
$new_window->add ($new_notebook);
$new_window->show_all;
# Either do it manually and return undef, or ...
#$notebook->remove ($page);
#$new_notebook->append_page ($page);
#return undef;
# ... simply return the new notebook and let gtk+ do the work.
return $new_notebook;
});
$w->add ($nb); $w->signal_connect (destroy => sub { Gtk2->main_quit; }); $w->show_all; Gtk2->main;
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 171:
Unknown directive: =comment