def __init__(self): self.model = Model() self.view1 = View() self.view1.setMoney(self.model.myMoney) self.view2 = ChangerWidget() self.view1.Show() self.view2.Show() pub.subscribe(self.changeMoney, "money_changing")
def __init__(self): self.model = Model() #set up the first frame which displays the current Model value self.view1 = View() self.view1.setMoney(self.model.myMoney) #set up the second frame which allows the user to modify the Model's value self.view2 = ChangerWidget() self.view1.Show() self.view2.Show() pub.subscribe(self.changeMoney, 'money_changing')
def __init__(self): self.timerResetValue = 5 self.model = Model() #set up the first frame which displays the current Model value self.view1 = View() self.view1.setTimerView(self.model.timerValue) #set up the second frame which allows the user to modify the Model's value self.view2 = ChangerWidget() self.view2.setTimerButtonText(self.timerResetValue) self.view1.Show() self.view2.Show() # Notify MODEL and persist data ... pub.subscribe(self.model.startTimer, 'timer_starting') # when a timer is started pub.subscribe(self.model.stopTimer, 'timer_stopping') # when a timer is stopped pub.subscribe(self.model.changeTimer, 'timer_changing') # when a timer changes it's value # self.timerThread(amount=99) # Notify VIEW ... # pub.subscribe(self.timerThread, 'timer_counting') # when a timer changes it's value pub.subscribe(self.timerThread, 'timer_starting') # when a timer starts