-in => *$master*
insert the slave(s) at the end of the packing
order for the master window.
####
use strict;
use Tk;
use Tk::NoteBook;
my $mw = MainWindow->new;
$mw->geometry('100x200');
my $nb = $mw->NoteBook()->pack(-fill => 'both',
-expand => 1);
my $page_tab_01=$nb->add ("TAB-1",
-label=>'TAB-1',
-raisecmd=>\&callback_01);
my $page_tab_02=$nb->add ("TAB-2",
-label=>'TAB-2',
-raisecmd=>\&callback_02);
my $t_button = $page_tab_01->Button(-text=>'OK',
-command=>sub{exit});
MainLoop;
sub callback_01 {
$t_button->packForget;
$t_button->pack(-in=>$page_tab_01);
}
sub callback_02 {
$t_button->packForget;
$t_button->pack(-in=>$page_tab_02); #<---ERROR HERE
}
####
error:can't pack .notebook.tAB_1.button inside .notebook.tAB_2