from notification.NotificationListView import NotificationListView
def new_populate(self):
message = {'typeID': 1,
'message': {'bgIcon': '',
'defaultIcon': '',
'savedData': 0,
'timestamp': -1,
'filters': [],
'buttonsLayout': [{'action': 'action_1',
'type': 'submit',
'label': 'Button 1',
'width': 80}, {'action': 'action_2',
'type': 'cancel',
'label': 'Button 2',
'width': 80}],
'message': 'Test Message',
'type': 'black',
'icon': 'img://gui/maps/icons/buttons/remove.png'},
'entityID': 99999,
'auxData': ['GameGreeting']}
old_populate(self)
self.as_appendMessageS(message)
old_populate = NotificationListView._populate
NotificationListView._populate = new_populate
def new_onClickAction(self, typeID, entityID, action):
if action == 'action_1':
print 'action_1'
elif action == 'action_2':
print 'action_2'
else:
old_onClickAction(self, typeID, entityID, action)
old_onClickAction = NotificationListView.onClickAction
NotificationListView.onClickAction = new_onClickAction