s there any cssh/ssh TK module or ability that allows me to just say place open window 1 to x,y - window 2 x,y - window 3 x,y - etc. or pipe the system call to a widget that can be controlled via grid or frame?

Yes to all those questions. :-)

Considering you are using Proc::Background to run your c based ssh connections, your best bet for this style of code may be to make individual mainwindows for each connection, otherwise you would make one mainwindow, and the rest would be dependent toplevels. If you go the toplevel route, you may still run into the blocking of the eventloop. The best solution would be to run each ssh instance in it's own thread, and display all the input/output in a set of Text widgets.

But lets just get back to just opening multiple mainwidows( independent eventloops) and controlling their placements. It's quite simple. The general way to do it is:

$widget -> geometry("wxh+x+y") width (w), height (h), yposition (x), and yposition (y) can be set as +string using above syntax. Position and size can be set independently, e.g. "+x+y" or "100x200". Without a parameter the actual size and position is returned in the ab +ove syntax. Attention: Values are "0" before the widget has manifested itself on t +he screen; use update() or waitVisibility() if unsure. Note: All values are in pixels. The screensize can be requested using $top -> screenwidth() and $top -> screenheight() Thus (e.g.): $h = $top->screenheight() - 40; $w = $top->screenwidth() - 40; $top -> geometry("${w}x$h+20+20") # if you specify -0-0 for position, you anchor in the lower right corn +er
Here is a rudimentary example, almost a Window Bomb. :-)
#!/usr/bin/perl use warnings; use strict; use Tk; my ($x,$y,$count) = (0,0,0); for(1..15) { $count++; if (fork == 0) { #$widget->geometry("wxh+x+y") my $top = new MainWindow; $top->geometry('100x100'.'+'.$x.'+'.$y); $top->Button(-command => sub { warn "top$_" })->pack; MainLoop; CORE::exit(); } if( $count % 3 == 0) {$y += 150; $x = 0 } $x += 150; } MainLoop; #If you need start a new process from one of the child processes, then #you have to establish some kind of IPC (e.g. pipes) between the child #and parent. #I the launched task running another Perl/Tk module or function or a #complete new program? In the latter case, you should just use fork an +d #exit/system and do not forget to use CORE::exit instead of exit in th +e #child process (according to the FAQ). Perl/Tk forks are somewhat more #difficult. You have to make sure that you fork off the process which #does not have a created a MainWindow itself. This will work fine:

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Perl/Tk + CSSH by zentara
in thread Perl/Tk + CSSH by Monkless

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.