Isn't wx event system already an implementation of observer pattern?
An example to illustrate my point:
class View
def __init__(self, dlg):
self.obj = wxButton(dlg, ID_BTN, "Click HERE")
..do somthing with button visual aspect, ie: bgcolor
class Model:
name = ""
class Controller:
def __init__(self, dlg):
view = View(dlg)
view.obj.Bind(wx.EVT_BUTTON, self.ButtonClicked)
def ButtonClicked(self, **args, **kwargs):
model = Model() args[0].GetEventObject().SetLabel(model.name)
Can GOF expert give any comment here?
Sbaush wrote:
···
The MVC must use Observer pattern. The code of observer.py is Python translation of GOF Observer code.