'clicking an ipyvuetify button programmatically (part 2): Why .fire_event('click', None) does not work

I would like to know why one of the answers to this question is not working. run programmatically an ipyvuetify button

A user said: looking at the description of the v.Btn class I found this :

| ---------------------------------------------------------------------- | Methods inherited from ipyvue.VueWidget.Events: |
| fire_event(self, event, data) |
| on_event(self, event_and_modifiers, callback, remove=False) I then assume that

b.fire_event('click', None)

should do trick

But this is not the case. When doing

import ipyvuetify as v
b = v.Btn(children=['this btn'])
help(b)

indeed fire_event(self, event, data) exists but it is not called as such:

b.fire_event('click', None)

ERROR: 99 def fire_event(self, event, data): --> 100 self._event_handlers_map[event](self, event, data)

KeyError: 'click'

How can you use this function of the button?

thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source