Dear Monks,
I want to create a scrolled main window using Tk::Pane. But I have problems using the geometry manager 'place' to create my widgets. For example in the below code the button does not appear.
use Tk;
use Tk::Pane;
$main_window=MainWindow->new(-title=>"Program");
$main_window->geometry("800x600");
$main_pane=$main_window->Scrolled('Pane',-scrollbars=>'osoe',-backgrou
+nd=>"GhostWhite",-sticky=>'n',-gridded=>'y')->pack(-fill=>'both',-exp
+and=>1);
$main_pane->Button(-text=>'EXIT',-command=>sub{exit;})->place(-x=>200,
+-y=>200);
MainLoop;
If I replace ->place(-x=>200,-y=>200) with ->pack() it appears. What am I doing wrong?
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.