# works:
# 	perl todo-bug.embed-scrolled
# 	perl todo-bug.embed-scrolled dada
# fails (embedded Scrolled Text not visible):
# 	perl todo-bug.embed-scrolled sucks

use Tk;
my $top = Tk::MainWindow->new();

  my $t = $top->Scrolled('Text', -setgrid => 'true', -width => 60,
			 -height => 24, -scrollbars => 'e',
			 -wrap => 'word',
			 -relief => 'flat',
			 -borderwidth => 0,
			 -highlightthickness => 0,
			 -cursor => 'top_left_arrow');
  $t->pack(-expand => 1, -fill => 'both');

#Then, awhile later....
#...implemented here as a callback ;-)

my $b = $top->Button(-text=>"create embedded", -command => sub {
  $t->insert('end', "\nNew action:\t\t");
  my $newaction;
if (!@ARGV)
  {
  print "Works...\n";
  $newaction = $t->Text(-width => 30,
  			  -height => 5, -wrap => 'none');
  }
else
  {
  print "Sucks...\n";
  $newaction = $t->Scrolled('Text', -width => 30, -height => 5,
  			    -wrap => 'none');
  if ($ARGV[0] eq 'dada')
    {
  	print "No, no. Here it goes :-)\n";
        $t->update,
    }
  }
  $t->window('create', 'end', -window => $newaction);
  print "Manager: ", ($newaction->manager), "\n";
  print "Geometry: ", ($newaction->geometry), "\n";
  $t->insert('end', "\nend\n");

}) ->pack;

Tk::MainLoop;
__END__
