Hi,
I have created a window, which has a scrolled frame in it with a grid of canvases, which I added with the grid geometry manager.
The problem is that when I use the gridSize method, I get 0 for both number of rows and columns. When I replaced the 'Scrolled' Frame with a regular Frame the problem is solved.
Can anyone think of a reason (or work around?)
Here's an example code:
use Tk;
use Tk::Pane;
$mw = MainWindow->new;
$graph_pane = $mw->Scrolled('Frame',
-scrollbars => 'osoe',
)->pack(
-fill => 'both',
-expand => 1,
);
for $i (0 .. 2){
for $j (0 .. 3){
$c=$graph_pane->Canvas(
-width => 250,
-height => 100,
-background => 'white',
)->grid(
-row => $i,
-sticky => "nsew",
-column => $j,
);
$c->createText(10,10,
-text => $i . ',' . $j,
-font => "{Arial} 8 bold",
);
}
}
($col, $row) = $graph_pane->gridSize( );
warn($col);
warn($row);
MainLoop;
** if you use:
$graph_pane = $mw->Frame(
instead of:
$graph_pane = $mw->Scrolled('Frame',
-scrollbars => 'osoe',
problem is solved! - but no scrollbar...
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.