This clears up my confusion, Thanks for the help.

Tony

-----Original Message-----
From: Gisle Aas [mailto:gi...@activestate.com] 
Sent: Tuesday, August 25, 2009 9:31 AM
To: Ken Slater
Cc: Tony W. Bass; activeperl@listserv.ActiveState.com
Subject: Re: Scrollbar on main window


On Aug 25, 2009, at 16:53 , Ken Slater wrote:

> At 04:37 PM 8/23/2009, Tony W. Bass wrote:
>> Content-class: urn:content-classes:message
>> Content-Type: multipart/alternative;
>>        boundary="----_=_NextPart_001_01CA2431.805F7A3E"
>>
>> Can anyone tell me how to make the entire tkx window scrollable?
>>
>> my $mw = Tkx::widget->new(".");
>>
>> My application takes a lot of screen space and I need to make it
>> scrollable if the users screen resolution is not set high enough.
>>
>> I am starting to pull out what little hair I have left over this.
>>
>> Many Thanks,
>>
>> Tony
>> _______________________________________________
>
> This may help. I'm new to Tkx and was trying to convert some Tk code.
> I finally got a scrollbar to work in this example.
> Ken

Thanks.  I've taken the liberty of cleaning up your example a bit.   
That gives me the following program.

--Gisle


#!/usr/bin/perl
#  Example of scrollable frame in Perl using the
#  Tkx module.  Based on Tcl code at http://wiki.tcl.tk/1091.

use strict;
use warnings;
use Tkx;
Tkx::package_require("BWidget"); # new_ScrolledWindow

my $mw = Tkx::widget->new('.');

my $mws = $mw->new_ScrolledWindow();
$mws->g_pack(-expand => 1, -fill => "both");

my $mwsf = $mws->new_ScrollableFrame();
$mws->setwidget($mwsf);

# Fill this frame instead of $mw directly
my $mwf  = Tkx::widget->new($mwsf->getframe);

for my $idx ( 1 .. 60 ) {
    $mwf->new_checkbutton(
        -text => $idx,
    )->g_pack(-side=>'top', -anchor=>'w');
}

Tkx::MainLoop();

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to