Hi monks,

I have a Tk app on Win32 with several buttons visible for users to press. One button has a binding configured for it like so:

$tl->bind("<Alt-Key-R>", sub { $Redo_PrettyPrint_b->invoke(); } );

Another button allows a user to invoke their own separate program with some parameters via putting their program's path in a variable that is then executed by a 'system' call. (The Tk app is self-contained and the user only wants it to run on his/her own behalf, and so I don't think I have concerns about tainting...)

-command => sub { ... $ccmd_rc = system $auto_check_command, @ac_args; warn "'Auto-Check' problem: ", $? >> 8, "\n" if $ccmd_rc; ...
My question is: What can the user do within the code of the $auto_check_command (which happens to be a Perl script :-) to invoke the aforementioned $Redo_PrettyPrint_b button? That is, how can their "other" Perl script "signal" the Tk app that has the $Redo_PrettyPrint_b button to react just as though the key sequence of 'Alt-Key-R' was pressed at the keyboard? The other script just needs to send this 'Alt-Key-R' sequence into the ether, it doesn't require feedback about success of its "virtual press" of the $Redo_PrettyPrint_b button. Thanks.

In reply to poke Tk via signal, hotkey, buttonpress, etc.? by ff

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.