What is wrong with this code??? I reading O'Reilly's "Advanced perl Programming". I am trying to learn tk. I copied the program word for word and I get this error when it runs:
unknown option "width" at C:/Perl/site/lib/Tk/Widget.pm line 205. at C:\Documents and Settings\ssherman\Desktop\gui.pl line 20
#
#
# GUI TEST PROGRAM
#
#
use Tk;
# --------------------------------------------------------------------
+-----
# Create a main window
# --------------------------------------------------------------------
+-----
$top = MainWindow->new();
$top->title ("Simple");
# --------------------------------------------------------------------
+-----
# Instantiate widgets and arrange them
# --------------------------------------------------------------------
+-----
$l = $top->Label(text => 'hello', #label properties
anchor => 'n', #anchor test to "north"
relief => 'groove', #border style
width => '10', height => '3');#10 chars wide, 3 high
$l->pack(); # give it a default place within the main window
# --------------------------------------------------------------------
+-----
# Sit in an infinite loop dispathing incoming events.
# --------------------------------------------------------------------
+-----
MainLoop();
I also have ActiveState perl 5.8
I did try the dash, -width and that worked. I guess my question now is why can Aquarium run the program above with no problems and when I do it does work without the dash
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.