In this recipe, we explore what a responsive interface is and try to gain a good understanding of what the problem is that the other recipes in this chapter will provide solutions to. The recipe creates a simple application with two buttons. Each button will perform exactly the same task. However, the way in which the application responds and provides feedback to the user after the button is clicked will differ greatly between the two buttons, due to how the control flow is carried out.
To illustrate the issue at hand, we will create a simple Fibonacci number calculator application. First, we will begin by defining a Thread class and the function that will be used to calculate the Nth Fibonacci number:
import wx import threading class FibThread(threading.Thread): def __init__(self, window, n): super(FibThread, self).__init__() # Attributes self.window = window self.n = n def run(self): val = SlowFib(self.n...