Hi all,
1st time here so bear with me as I settle in Also please cut me some slack as I am fairly new to (wx)Python.
My program is on a PC (and hopefully, eventually, to a tablet) and connects to external microp-based h/w thru a Bluetooth serial interface. The nature of the program is that I’m defining 7 or 8 main functions and a number of subfunctions (mainly configuration) with a subset defined for each main function.
Both the main functions and subfunctions are basically “infinite loops” (“while” statements) in that changing main functions and/or getting into/out of subfunctions will be done by button events. The problem is that if I use “while” and depend on button events for (sub)function switching, pressing a button does not seem to get serviced (i.e. generate an event to process).
I have the following code at the end of my main, defining/init class:
if __name__ == '__main__':
app = wx.App()
frame = FreqCntrWindow()
app.MainLoop()
FreqCntrWindow is my main class def. My sense is that wx.App is where the button events are acknowledged and directed to the callback function for processing. The problem is that’s not happening because of the catch-22 of my “while”-conditioned code never allowing wx.App to deal with any button events.
Is there a way I can “poll” for button events from within my code (define a function and return a Boolean and maybe a button name)? Or am I approaching this wrong.
Thanks in advance and appreciate any help or insight…cheers…