spx2 has asked for the wisdom of the Perl Monks concerning the following question:
I have the following situation. I have made some buttons that do actions but now I also want to make some keybindings. The problem is, that in the keybindings I'll have the same code from the buttons,and to avoid duplicating it I'd like to know how to emulate button pushes ,if possible(so that I can emulate the button pushes in the keybindings I want to make). I'm pretty sure I was able to do that on win32api. I remember I would do enumwindow and then findwindow and sendmessage WM_COMMAND or something similar(only difference was,that there I was trying to emulate press button on programs that were not made by me,here I have this perl script that I should be able to control much better). Can I do that here too , but in a simpler way , because I already have the object(the button).
More Clearly: How can one send events to a certain object in Perl/Tk ?
I'd also like to ask if possible about getting to a certain object if one only has access to the mainwindow of Tk.
If one only has access to a Tk main window how would it be possible to access objects on the Tk main window ? Would it be a good ideea to make a global hash in wich one puts references to all objects created ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: emulate Tk button push
by zentara (Cardinal) on Sep 19, 2007 at 09:52 UTC | |
by spx2 (Deacon) on Sep 19, 2007 at 13:08 UTC | |
Re: emulate Tk button push
by mmmmtmmmm (Monk) on Sep 19, 2007 at 09:14 UTC | |
by spx2 (Deacon) on Sep 19, 2007 at 09:22 UTC | |
by jdporter (Paladin) on Sep 19, 2007 at 12:20 UTC | |
by spx2 (Deacon) on Sep 19, 2007 at 13:18 UTC |