Hi all,
I have an accelerator table that binds a lot of functions to as many
keystrokes. I now need to get the return value of any function called
by a keystroke in the table. For example, if every function bound in
the table returns true or false, I could loop until something returns
false:
ok=False
while not ok:
ok=#AcceleratorTable.CalledFunction #set to return value of whatever
func was #called by the most recent keystroke
Is such a thing possible?
The situation is that I have a battleship game. I have two players,
each a Player object. I will be switching from one to the other, and
so I need to wait until player1 calls a function that returns True; as
soon as that happens, I will switch over to player2 and wait until
player2 does something that returns True, then switch back to player1,
and so on. To do this, it seems like my best option is to have a
Player.takeTurn() function which just waits in a while loop, like the
example above, until the player does something. At that point, I will
switch to the other player and call the new player's takeTurn method,
then switch back the same way.
I hope this makes sense. I thought of looking through the wx source in
the site-packages folder but I could not find where the
AcceleratorTable is stored. TIA!
···
--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; http://www.facebook.com/mehgcap