Straight from
crazy tk xbm thingy
$GOB{W} = new MainWindow(-background => 'darkblue',
-borderwidth => 1,
-relief => 'groove',
-width => 500,
-height => 500,
,);
$GOB{W}->title("crazy tk xbm thingy");
which you could've also found somewhere in the pod (
Tk::MainWindow I think, haven't checked)
update: better yet, Tk::Internals led me to Tk::Wm which says:
- $toplevel->title(?string?)
-
If string is specified, then it will be passed to the window
manager for use as the title for $toplevel (the window manager
should display this string in $toplevel's title bar). In this
case the method returns an empty string. If string isn't
specified then the method returns the current title for the
$toplevel. The title for a window defaults to its name.
update: I looked for it, and straight from Tk::Internals:
- Inside $top->title('Text demo');
-
The package Tk::Toplevel defines a lot of subroutines on the fly on
some list. All the commands from the list are converted to the
corresponding subcommands of wm method of the widget. Here
subcommand is a command with some particular second argument (in this
case "title"). Recall that the first argument is $self.
Now Tk::Toplevel @ISA Tk::Widget, that in turn @ISA Tk. So a
call to $top->wm('title','Text demo') calls Tk::wm, that is
defined during call to Tk_CreateMainWindow(). As it is described
above, the XSUB associated to XStoSubCmd() is called.
This C routine is defined in tkGlue.c. It gets the data part of
XSUB, creates a SV with the name of the command, and calls
Call_Tk() with the XSUB data as the first argument, and with the name
of XSUB stuffed into the Perl stack in the place there tk expects
it. (In fact it can also reorder the arguments if it thinks it is
what you want).
The latter procedure extracts name of tk procedure and
clientData from the first argument and makes a call, using Perl
stack as argv for the procedure. A lot of black magic is performed
afterwards to convert result of the procedure to a Perl array return.
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
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.