Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Scrolled within a Scrolled

by Sandy (Curate)
on Nov 28, 2008 at 18:22 UTC ( [id://726647]=note: print w/replies, xml ) Need Help??


in reply to Scrolled within a Scrolled

This works for me on Windows and Solaris (perl 5.8.8)
use strict; use Tk; my $mw = MainWindow->new; $mw->geometry("1200x850"); my $p = $mw->Scrolled('Pane', -scrollbars => 'se', -width=>'1200', -height=>'850' )->pack; my $listbox1=$p->Scrolled('Listbox', -scrollbars=>'e', -exportselection => 0 )->place(-anchor=>'nw', -x=>"50", -y=>"150"); $listbox1->configure(-height=>'35', -width=>'25', -selectmode => "browse"); $listbox1->insert('end',1..150); MainLoop();
Is it perhaps because you forgot the MainLoop() ??

Replies are listed 'Best First'.
Re^2: Scrolled within a Scrolled
by Commy_Code_Monkey (Acolyte) on Nov 28, 2008 at 19:33 UTC
    Interesting... as a separate file it also works for me... But in with the rest of my code, the scrolled listboxes still refuse to show up. (No I did not forget MainLoop, but I'd ask me that too) If I change $listbox1 to a non-scrolled widget... it displays. ie...
    #my $listbox1=$p->Scrolled('Listbox', # -scrollbars=>'e', # -exportselection => 0 # )->place(-anchor=>'nw', # -x=>"50", # -y=>"150"); my $listbox1=$p->Listbox()->place(-anchor=>'nw',-x=>"50",-y=>"150"); + $listbox1->configure(-height=>'35', -width=>'25', -selectmode => " +browse");
    It just does NOT like the scrolled option. I'm running ActivePerl 5.10.0.1004 on a WinXP machine btw.
Re^2: Scrolled within a Scrolled
by Commy_Code_Monkey (Acolyte) on Dec 01, 2008 at 14:37 UTC
    AFter some additional tinkering and even more swearing... I've found that the Pane widget, doesn't actually act like a scrolled frame as the docs said. They apparently have a limit on how many scrolled widgets they can contain. That's why my example code works... and my actual code did not. I was able to bypass this problem by specifying a new frame for each scrolled widget in the pane. Is there a subroutine to get those 4 hours of my life back...?
    my $p = $mw->Scrolled('Pane', -scrollbars => 'se', -width=>'1200', -height=>'850' )->pack; my $fr1=$p->Frame()->place(-anchor=>'nw', -x=>"50", -y=>"150");; my $listbox1=$fr1->Scrolled('Listbox', -scrollbars=>'e', -exportselection => 0 )->pack; my $fr2=$p->Frame()->place(-anchor=>'nw', -x=>"50", -y=>"150"); my $listbox2=$fr1->Scrolled('Listbox', -scrollbars=>'e', -exportselection => 0 )->pack;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://726647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2026-04-11 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.