Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

How I Summoned the Planes

by Petruchio (Vicar)
on Jan 02, 2001 at 00:41 UTC ( [id://49218]=monkdiscuss: print w/replies, xml ) Need Help??

With the server change, you may have noticed that the Chatterbox clients are mostly, if not all, broken. This will, I suspect, probably be resolved shortly, because I would imagine that www.perlmonks.org will be resolving to 206.170.14.76 shortly.

In the meantime, I went through the code (which I understand only superficially) and changed each instance of www.perlmonks.org to 206.170.14.76 - and lo! A cargo plane dropped off a working getchat.pl and monkchat Perl/Tk client. I thought that I should post this more promptly than carefully, since the problem is immediate. It does seem to me that this sort of configuration information should be gathered together in a .monkchatrc file, to be read and exported as variables by a module. Presently the addresses are spread throughout the sundry files.

I was similarly inspired to look at the some code in a language I don't understand, and write some code for a module I understand poorly. By adding the lines:

{ my @command = ($0,@ARGV); $Window->command(?@command?); } $Window->group($Window);
to the Tk CB client, I was able to make it produce a WindowMaker Icon. I announce this here because the code is useful, but doubtless no good, and could use fixed by someone who actually understands it. :-)

*sigh* Oh great Cargo Gods... send us a sign! Your servant is calling...

Replies are listed 'Best First'.
Re: How I Summoned the Planes
by mkmcconn (Chaplain) on Jan 02, 2001 at 07:04 UTC
    I don't understand the curly brackets
    { my @command = ($0,@ARGV); $Window->command(?@command?); }
    What do you suppose that does? Is it an artifact of Tcl code? Neither could I find where command and group are inherited from. But, simply including in the initWindow subroutine:
    #... sub initWindow { print STDERR "Initializing Tk window...\n" if ($opt_debug); $Window = MainWindow->new(-title => "Perlmonks Chat"); $Window->group($Window); #... ^^^^^^
    is enough to create a WindowMaker icon. Like you, I'm not comfortable that something works, when I don't know why it works - maybe it's not working the way I imagine.

    What's the best way to research inheritance in an Object Oriented program? How do I know I've found the attributes that are inherited?
    UPDATE

    I found this concerning Tk::Wm.
    And the following descriptions.
       $toplevel->command(?value?) 
    
            If value is specified, this method stores value in $toplevel's
            WM_COMMAND property for use by the window manager or session
            manager and returns an empty string. Value must have proper list
            structure; the elements should contain the words of the command
            used to invoke the application. If value isn't specified then the
            method returns the last value set in a command method for
            $toplevel. If value is specified as an empty string, the method
            deletes the WM_COMMAND property from $toplevel. 
    
     $toplevel->group(?$widget?) 
    
            If $widget is specified, it is the the leader of a group of related
            windows. The window manager may use this information, for example,
            to unmap all of the windows in a group when the group's leader is
            iconified. $widget may be specified as an empty string to remove
            $toplevel from any group association. If $widget is specified then
            the method returns an empty string; otherwise it returns the
            $toplevel's current group leader, or an empty string if $toplevel
            isn't part of any group. 
    

    That helps a bit. But I'm not sure that I understand the relationship in the Object hierarchy, even for all that.

    mkmcconn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://49218]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found