in reply to Re^2: misplaced scroll bar with Tk::Table
in thread misplaced scroll bar with Tk::Table

What do you actually want to achieve? The sample code below may give a better feel for what is going on. Note that the columns are not fixed and that the width of the entries is enough that not all the columns are visible.

The key point is that the scroll bars only scroll non-fixed columns.

use Tk; use Tk::Table; use strict; use warnings; my $mw = MainWindow->new; $mw->geometry("200x200"); my $table = $mw->Table (-rows => 9, -columns => 9, -fixedrows => 9)->pack; foreach my $row (0 .. 8) { foreach my $col (0 .. 8) { my $cell = $table->Entry (-width => 4, -text => "$col, $row"); $table->put ($row, $col, $cell); } } MainLoop;

Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^4: misplaced scroll bar with Tk::Table
by pg (Canon) on Aug 12, 2005 at 10:56 UTC
    "What do you actually want to achieve?"

    I want to demo a bug ;-) I think you misunderstood my point. Whether there was a better way is not important here. The point is that Tk::Table should not display that scrollbar in that strange way regardless.

    But thanks for your kindness and the sample code!

      I don't think I have seen a bug in the module as such. Consider the following quote from the documentation:

      A number of rows and/or columns can be marked as 'fixed' - and so can serve as 'headings' for the remainder the rows which are scrollable.

      and also:

      Entries in the Table are simply ordinary perl/Tk widgets. They should be created with the Table as their parent.

      Your sample code ignored the second instruction. That is not a bug in the module; it is a bug in your code. Having fixed that the scroll bar was correctly generated over the only column that was not fixed. That column is very narrow: so also therefore is the scrollbar. That is not a bug either.


      Perl is Huffman encoded by design.