On Aug 27, 2009, at 12:59 , Tony W. Bass wrote: > Gisle, > > Yesterday was way too long, please note that I actually attached the > code this time. I will post this to the list also for posterity's > sake. > > Sorry to get back to you off the list but I implemented the following > snippet (grossly reduced app) and it works fine on my xp sp3 box, a > test > xp sp2, and my win 2003 server but on any of my clients servers or > pc's > (4 so far) I've tried it on it hangs, never shows the interface and > eats > up 50% CPU until it is killed. Makes no difference whether I run it on > the command line via perl or compiled via perlapp. I pull the code for > BWidget out and it works fine. When I run it through debug it seems to > be getting into an endless loop after it branches into the Tkx module. > Any ideas on where to look would be greatly appreciated.
I don't really see anything wrong with it, but it does seem odd to have scrollbars outside of a notebook. Isn't that something you want to have inside on those tabs where it's required. --Gisle > > ------ Start Code ------- > #!c:/perl/bin -w > use strict ("vars"); > use warnings; > use Tkx; > > Tkx::package_require("BWidget"); > > my $mwb = Tkx::widget->new("."); > $mwb->g_wm_geometry("+0+0"); > my $mws = $mwb->new_ScrolledWindow(); > $mws->g_grid(); > my $mwsf = $mws->new_ScrollableFrame(-width=> 1024, -height=> 782); > $mws->setwidget($mwsf); > my $mw = Tkx::widget->new($mwsf->getframe); > > $mwb->g_wm_title("Some Title"); > > (my $nb = $mw->new_ttk__notebook(-height => 758, -width => > 1024))->g_grid(); > > Tab1(); > Tab2(); > > Tkx::MainLoop(); > > > sub Tab1 { > my $tab1 = $nb->new_ttk__frame(-padding => "10"); > } > sub Tab2 { > my $tab2 = $nb->new_ttk__frame(-padding => "1"); > $nb->add($tab2, -text => 'Sales', -state=>'normal'); > } > > --------End Code--------- > > Thanks, > > Tony Bass > > -----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 _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs