problems with the scrolling multiple widgets in FAQ 
Author Message
 problems with the scrolling multiple widgets in FAQ

First, what is the address for the ptk mailing list. I've sent a subscribe

thought the list at wpi.edu was moved.

I am using the latest pTk Beta 11-02 on Solaris2.5/Sparc Ultra.

I would like to scroll a group of widgets, say label and labelentry ones.
In the first case, I've created a frame, created subframes, packed the labels
inside, and then  configured the scrollbar.  The message I get is

/usr/local/lib/perl5/site_perl/auto/Tk/Scrollbar/ScrlByUnits.al line 12
It seems like a frame should be able to be scrolled. However, the only things
that will work are Listbox,Text,Canvas.

Then if I try to follow the example in the FAQ, I get a message about
unknown option "-yscrollcommand" at the label configure statement.

I would really appreciate any help.

Thanks,

Robert


Script 1: Associate scrollbar with a frame
#=========================================
#!/usr/local/bin/perl5

use Tk;

my $top = MainWindow->new();
# Widget to be scrolled
$c =  $top->Frame(-relief => ridge, -borderwidth => 1);

# Add a scroll bar
#$sb = $top->Scrollbar("-command" => [ \&multiscrolly, $sb, [$g, $h]]);
$sb = $top->Scrollbar("-command" => [ yview, $c]);

# Configure the frame
$c->configure("-yscrollcommand" => ["set", $sb]);
#pack
$c->pack(-side => left, -expand => 1, -fill => both );
$sb->pack( "-side"   => "right", -expand => 1, "-fill"   => "y");

$f = $c->Frame(-relief => ridge, -borderwidth => 4)->pack(-side => top,
                                                          -expand => 1,
                                                          -fill => both
                                                          );
then create two frames within $f that will contain the labels & entries.

This is basically the example from the FAQ
=================================
#!/usr/local/bin/perl5

use Tk;
my $top = MainWindow->new();
$c =  $top->Frame(-relief => ridge, -borderwidth => 1);

#
# The example uses Label, Text, Listbox widgets here
#
$l1 = $c->Label(-text => "line 1")->pack(-side => top);
$l2 = $c->Label(-text => "line 2")->pack(-side => top);

$s = $top->Scrollbar;
$s->configure(-command =>  [ \&multiscrollx, $s, [$l1,$l2]] );

$l1->configure( '-yscrollcommand' => [ 'set', $s] );
$l2->configure( '-yscrollcommand' => [ 'set', $s] );

$c->pack(-side => left, -expand => 1, -fill => both );
$s->pack( "-side"   => "right", -expand => 1, "-fill"   => "y");

MainLoop;

sub multiscrolly
{

    my $w;


    }

Quote:
}



Sun, 20 Dec 1998 03:00:00 GMT  
 problems with the scrolling multiple widgets in FAQ

Quote:

> First, what is the address for the ptk mailing list. I've sent a subscribe

> thought the list at wpi.edu was moved.

> I am using the latest pTk Beta 11-02 on Solaris2.5/Sparc Ultra.

> I would like to scroll a group of widgets, say label and labelentry ones.
> In the first case, I've created a frame, created subframes, packed the labels
> inside, and then  configured the scrollbar.  The message I get is

> /usr/local/lib/perl5/site_perl/auto/Tk/Scrollbar/ScrlByUnits.al line 12
> It seems like a frame should be able to be scrolled. However, the only things
> that will work are Listbox,Text,Canvas.

> Then if I try to follow the example in the FAQ, I get a message about
> unknown option "-yscrollcommand" at the label configure statement.

> I would really appreciate any help.

Tiler and Table are both "Frames that Scroll".

Tiler just scrolls in 'y' and packs as many of a list of
things as in can in 'x'.

Table is more sophisticated.



Tue, 22 Dec 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. scrolling multiple widgets

2. Q: scrolling multiple widgets simultaneously?

3. Scrolling Multiple Widgets

4. scrolling multiple widgets with one scrollbar

5. Scrolling Multiple Widgets

6. Tk::Scrolled-widget does not scroll with Cursor-Up/Down-Keys

7. : Problems with multiple in scrolling list and group of checkboxes

8. Multiple choices in scroll down box in form

9. moving a scroll for a ROText widget

10. Scrolled List of Widgets

11. Scrolling fields of widgets (fwd)

12. Cursor not settable in Scrolled widgets

 

 
Powered by phpBB® Forum Software