Gee, good question. I'm just brainstorming here, but maybe it will lead you onto the right path. I would look at X11::SendEvent and X11::WMCtrl . The following is some code which I tried, but never got to work.
#!/usr/bin/perl use warnings; use strict; use X11::SendEvent; use X11::WMCtrl; use Data::Dumper; my $wmctrl = X11::WMCtrl->new; my @windows = $wmctrl->get_windows; print Dumper([\@windows]),"\n"; $wmctrl->activate('foo'); $|++; my $win = X11::SendEvent->new( win => [ 'foo' ], debug => 1 ); for(1..100){ $win->SendString( "testing", [ "Return" ] ); $win->SendString( "user", [ "Return" ], "joe", [ "9/1" ] ); $win->SendKeycode( 119 ); $win->SendString( "zentara", [ "Return" ], [ "Return" ] ); } <>;
You can get the Tk widget's id with $mw->id. You probably should ask this on the newsgroup comp.lang.perl.tk. If you groups.google.com search for "Perl Tk ClientMessage" you will find this was the source of a critical bug in Tk code built on recent platforms. The patch that fixed it, may also prevent ClientMessaging from working the way you had hoped......but this is way over my head, and Slaven Rezic eserte ( the new Tk guru) is probably the only one who can answer you. Maybe message him here or ask on comp.lang.perl.tk. He is very busy so be patient.

P.S. "perldoc Tk::send" may also have some clues like the $mw->Receive(string) method.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: ClientMessage x11 <=> perl/tk by zentara
in thread ClientMessage x11 <=> perl/tk by bgiii

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.