Scrollbar on main window

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?



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
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
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">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Can anyone tell me how to make the entire tkx =
window
scrollable?<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>my $mw =3D Tkx::widget->new("."); =
<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>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.<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>I am starting to pull out what little hair I have =
left over
this.<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Many Thanks,<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Tony<o:p></o:p></p>

</div>

</body>

</html>

------_=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1441334182==--
Tony Bass [ So, 23 August 2009 22:37 ] [ ID #2013190 ]

Re: Scrollbar on main window

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Ken Slater [ Di, 25 August 2009 16:53 ] [ ID #2013466 ]

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Gisle Aas [ Di, 25 August 2009 18:31 ] [ ID #2013467 ]

RE: Scrollbar on main window

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Jan Dubois [ Di, 25 August 2009 18:41 ] [ ID #2013468 ]

RE: Scrollbar on main window

This clears up my confusion, Thanks for the help.

Tony

-----Original Message-----
From: Gisle Aas [mailto:gisle [at] activestate.com]
Sent: Tuesday, August 25, 2009 9:31 AM
To: Ken Slater
Cc: Tony W. Bass; activeperl [at] 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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Tony Bass [ Mi, 26 August 2009 15:36 ] [ ID #2013723 ]
Perl » gmane.comp.lang.perl.active-perl » Scrollbar on main window

Vorheriges Thema: syntax errors in perl
Nächstes Thema: Rewriting files