Hi
i am learning perl tk on windows xp using activestate perl 5.10 with tk 804.028.0.0, the following example about a menubar composed from the main item "File" and two subitems "Open file", "Save as"
when i click on the "File" there is a line between it and the other subitems, by luck i have clicked on this line as this picture
http://img23.imageshack.us/img23/184/tkmenu1.jpg and strangly another window have appeared; and on every click on this line another window appears as this picture
http://img30.imageshack.us/img30/6304/tkmenu2.jpg.
the first window is the parent and closing it will close all other childs. but closing a child windows will close only that window.
what is the procedure on which clicking on this line invoke a child window ?
is this the same behaviour in linux?
thanks
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $mw = tkinit;
my $menubar = $mw->Menu(-type => 'menubar');
$mw->configure(-menu => $menubar);
my $text1 = 'File';
my $text2 = 'Open file';
my $text3 = 'Save as';
my $menu = $menubar->cascade(-label => $text1);
$menu->command(-label => $text2);
$menu->command(-label => $text3);
MainLoop;
__END__
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.