multithreading - wxpython: wait for events mainloop freezes -


i new wxpython, please gentle. trying make game using wxpython. need able handle events (button clicks) while game in progress.

the process is:

  1. deal cards
  2. wait user input
  3. continue accordingly

the way have implemented is:

app = wx.app() g = game() # calls g.play() executes process above app.mainloop() 

however application freezes. think problem relates being unable respond events while process being executed. how can around this?

i had @ threading, cannot see how make work in case. if create new thread deal user inputs within game(), not able update values in game().

i sure there "correct" way of doing don't know because unfamiliar wxpython. can help?

yo not need seperate function play() run game. set event handlers compute state of game during every event results in move of game.

a option define game state cards in each players hands, , turns have been played , scores, defined object of state class.

chalk out outline of how game's architecture first. , might want take @ examples , documentations on wxpython if new it.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -