creating a table with different widgets 
Author Message
 creating a table with different widgets

Hello,

i've got a problem creating a table. The table should contain different
widgets like
labels, entries and canvases. Tk::Table seems to be the right widget for
this stuff,
but there's a little problem...

when resizing the window, Tk::Table hides columns not fitting in the
window anymore.
This also affects attached scrollbars.....

Is there a way to prevent columns from being hidden ? Even using an
extra frame
to encapsulate the Tk::Table doesn't work.

I've also tried Tk::Grid instead of Tk::Table, but got problems with
scrollbars.
Too much rows of data.....

Another solution would be Tk::MListbox (and sure a solution i would
prefer), but
as fas as i know there is no way to put a canvas into this kind of list
boxes....

Thanks in advance...

Burkhard Linke, System Adminstration



Sat, 07 Sep 2002 03:00:00 GMT  
 creating a table with different widgets

Quote:

> Hello,
> i've got a problem creating a table. The table should contain different
> widgets like
> labels, entries and canvases. Tk::Table seems to be the right widget for
> this stuff,
> but there's a little problem...
> when resizing the window, Tk::Table hides columns not fitting in the
> window anymore.
> This also affects attached scrollbars.....
> Is there a way to prevent columns from being hidden ? Even using an
> extra frame
> to encapsulate the Tk::Table doesn't work.
> I've also tried Tk::Grid instead of Tk::Table, but got problems with
> scrollbars.
> Too much rows of data.....
> Another solution would be Tk::MListbox (and sure a solution i would
> prefer), but
> as fas as i know there is no way to put a canvas into this kind of list
> boxes....
> Thanks in advance...

Does this work as you'd like?

#!/usr/local/bin/perl -w

use Tk;
use Tk::Table;
use strict;

my $mw = MainWindow->new;
my $thumb = $mw->Scrolled('Table')->pack;

  THUMB:
    foreach my $r (1 .. 16) {
        foreach my $c (1 .. 16) {
            my $l = $thumb->Label(-text => "$/$c");
            $thumb->put($r, $c, $l);
        } # forend columns
    } #forend rows

MainLoop;

Quote:
> Burkhard Linke, System Adminstration

--

Lehigh University Computing Center, USA


Sat, 07 Sep 2002 03:00:00 GMT  
 creating a table with different widgets
Quote:


> > Hello,

> > i've got a problem creating a table. The table should contain different
> > widgets like
> > labels, entries and canvases. Tk::Table seems to be the right widget for
> > this stuff,
> > but there's a little problem...

> > when resizing the window, Tk::Table hides columns not fitting in the
> > window anymore.
> > This also affects attached scrollbars.....

*snipsnap*

Quote:
> > Thanks in advance...

> Does this work as you'd like?

> #!/usr/local/bin/perl -w

> use Tk;
> use Tk::Table;
> use strict;

> my $mw = MainWindow->new;
> my $thumb = $mw->Scrolled('Table')->pack;

>   THUMB:
>     foreach my $r (1 .. 16) {
>         foreach my $c (1 .. 16) {
>             my $l = $thumb->Label(-text => "$/$c");
>             $thumb->put($r, $c, $l);
>         } # forend columns
>     } #forend rows

> MainLoop;

> > Burkhard Linke, System Adminstration

> --

> Lehigh University Computing Center, USA

Hello again,

this is nearly the code i use...

The problem is scrolling and resizing the window.
If the viewable area changes, the Tk:Table widgets hiddes columns
outside the window. There is no smooth scrolling/resizing.
The scrollbars also change their width according to the _new_
viewable width of Tk::Table. Since my last column is very wide
(entries with about 70 characters..) it nearly impossible to scroll
to these columns. I have to resize the window to see them.
The only way to change this behavior i know is to set the geometry
of the window to a very large value (e.g. 900x600).
I'm looking for a way to use smooth scrolling....

Burkhard Linke, System Administration



Sun, 08 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Win32::ODBC - same field name in different tables causes trouble

2. script to modify database table as different user

3. how to use different colors in same line in text widget

4. Creating a file on a different NT File Server

5. Creating a file with a different GID

6. Perl TK Table Widget

7. need help with Table widget

8. Table Widget

9. Fastest Table-like widget

10. TABLE widget odd behavior

11. doc for Table widget in Tk-b9

12. Table widget documentation?

 

 
Powered by phpBB® Forum Software