def generate_code_event_bind(self, code_obj, tab, event_handlers):
    code_lines = []
    for (obj, event, handler, unused) in event_handlers:
        if obj.name:
            obj_id = ('%s->GetId' % self.format_generic_access(obj))
        else:
            obj_id = (self.generate_code_id(None, obj.id)[1] or '-1')
        if ('EVT_NAVIGATION_KEY' in event):
            tmpl = "%(tab)s%(event)s($self, $self->can('%(handler)s'));\n"
        else:
            tmpl = "%(tab)s%(event)s($self, %(obj_id)s, $self->can('%(handler)s'));\n"
        code_lines.append((tmpl % {'tab': tab, 'event': self.cn(event), 'handler': handler, 'obj_id': obj_id}))
    if event_handlers:
        code_lines.append('\n')
    return code_lines
def generate_code_event_bind(self, code_obj, tab, event_handlers):
    code_lines = []
    for (obj, event, handler, unused) in event_handlers:
        if obj.name:
            obj_id = ('%s->GetId' % self.format_generic_access(obj))
        else:
            obj_id = (self.generate_code_id(None, obj.id)[1] or '-1')
        if ('EVT_NAVIGATION_KEY' in event):
            tmpl = "%(tab)s%(event)s($self, $self->can('%(handler)s'));\n"
        else:
            tmpl = "%(tab)s%(event)s($self, %(obj_id)s, $self->can('%(handler)s'));\n"
        code_lines.append((tmpl % {'tab': tab, 'event': self.cn(event), 'handler': handler, 'obj_id': obj_id}))
    if event_handlers:
        code_lines.append('\n')
    return code_lines