In the following code, I access the top Frame subwidget (advertised by Tk::DialogBox) and then use a scrolling Tk::ROText widget.
use strict; use warnings; use Tk; use Tk::DialogBox; use Tk::ROText; my $mw = MainWindow->new(); my $d = $mw->DialogBox(); my $df = $d->Subwidget(q{top}); my $rt = $df->ScrlROText()->pack; my $content = join qq{\n} => (0 .. 100); $rt->insert(end => $content); $mw->Button(-text => q{Show}, -command => sub { $d->Show })->pack; $mw->Button(-text => q{Exit}, -command => sub { exit })->pack; MainLoop;
I use Subwidget() for greater control. The BUGS section of Tk::DialogBox has:
"There is no way of removing a widget once it has been added to the top Frame, unless you access the top subwidget and go through the child widgets."
-- Ken
In reply to Re: DialogBox and Scrollbars
by kcott
in thread DialogBox and Scrollbars
by mahis_431
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |