$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;" | [reply] [d/l] [select] |