ff has asked for the wisdom of the Perl Monks concerning the following question:
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...)
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.-command => sub { ... $ccmd_rc = system $auto_check_command, @ac_args; warn "'Auto-Check' problem: ", $? >> 8, "\n" if $ccmd_rc; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: poke Tk via signal, hotkey, buttonpress, etc.?
by PodMaster (Abbot) on Oct 08, 2003 at 20:16 UTC |