def on_click(self, event):
index = event["<STR_LIT:index>"]<EOL>button = event["<STR_LIT>"]<EOL>if index not in self._control_states.keys():<EOL><INDENT>if button == self.button_toggle:<EOL><INDENT>index = "<STR_LIT>"<EOL><DEDENT>elif button == self.button_stop:<EOL><INDENT>index = "<STR_LIT>"<EOL><DEDENT>elif button == self.button_next:<EOL><INDENT>index = "<STR_LIT>"<EOL><DEDENT>elif button == self.button_previous:<EOL><INDENT>index = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT><DEDENT>elif button != <NUM_LIT:1>:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>control_state = self._control_states.get(index)<EOL>if self._player and self._get_button_state(control_state):<EOL><INDENT>getattr(self._player, self._control_states[index]["<STR_LIT:action>"])()<EOL><DEDENT><DEDENT>except GError as err:<EOL><INDENT>self.py3.log(str(err).split("<STR_LIT::>", <NUM_LIT:1>)[-<NUM_LIT:1>])<EOL><DEDENT>
Handles click events