Once I've set up a click listener with e.g. ```myV...
# korge
j
Once I've set up a click listener with e.g.
Copy code
myView.onClick { ... }
is there a way to clear/remove that listener? Couldn't find anything in the documentation...
r
I don't think it's possible with
onClick { ... }
, you should check
Component
classes instead
j
Ok cool. Thanks!
So I dug into components a bit. I found
MouseComponent
but it doesn't appear to be nearly as full-featured as the extensions on View. For example,
Copy code
override fun onMouseEvent(views: Views, event: MouseEvent) {
        when {
            event.typeClick -> {
                // triggers whether or not mouse is inside view's bounds
                println("CLICKED!")
            }
            event.typeEnter -> {
                // never triggers?
                println("ENTER")
            }
        }
    }
I feel like I'm fighting the engine here, which probably means I'm doing something wrong...
r
you should check the implementation of the extensions, I can't help you here
j
No worries. I did look at how they're implemented. I have something that's working for me, I just wanted to make sure I wasn't missing something obvious since it seemed like a weird disconnect. 🙏