Scrollbar on main window
am 23.08.2009 22:37:14 von Tony Bass
This is a multi-part message in MIME format.
--===============1441334182==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01CA2431.805F7A3E"
This is a multi-part message in MIME format.
------_=_NextPart_001_01CA2431.805F7A3E
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Can anyone tell me how to make the entire tkx window scrollable?
=20
my $mw =3D Tkx::widget->new(".");=20
=20
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.
=20
I am starting to pull out what little hair I have left over this.
=20
Many Thanks,
=20
Tony
------_=_NextPart_001_01CA2431.805F7A3E
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Dus-ascii">
Can anyone tell me how to make the entire tkx =
window
scrollable?
my $mw =3D 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
------_=_NextPart_001_01CA2431.805F7A3E--
--===============1441334182==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1441334182==--
Re: Scrollbar on main window
am 25.08.2009 16:53:43 von Ken Slater
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
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Scrollbar on main window
am 25.08.2009 18:31:14 von Gisle Aas
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
RE: Scrollbar on main window
am 25.08.2009 18:41:45 von Jan Dubois
You may also want to take a look at the Tk tutorial. It includes sample
code in various languages for all its samples, including Perl using Tkx:
http://www.tkdocs.com/tutorial/index.html
Cheers,
-Jan
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Scrollbar on main window
am 26.08.2009 15:36:03 von Tony Bass
This clears up my confusion, Thanks for the help.
Tony
-----Original Message-----
From: Gisle Aas [mailto:gisle@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