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

#  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 $font = 'Courier 10 normal';

my $mw    = Tkx::widget->new('.');
my $mws   = $mw->new_ScrolledWindow();
my $mwsf  = $mws->new_ScrollableFrame();
#
#  This call returns a scalar, we need an object
#my $mwf   = $mwsf->m_getframe();
#  So we use _kid to find the frame object.
my $mwf   = $mwsf->_kid('frame');

$mws->setwidget($mwsf);
$mws->g_pack();
#
#  Do not pack the frame, this causes
#  scrollbars to not not work
#
#$mwf->g_pack();

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

Tkx::MainLoop();


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to