Skip to content

View.OnMouseClick/MouseClick should be deleted in favor of Activating #4176

@tig

Description

@tig

I think the OnMouseClick/MouseClick can be deleted and the default behavior be:

    MouseBindings.Add (MouseFlags.Button1Clicked, Command.Activate);
    MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Accept);

RaiseMouseClickEvent is not needed; the code that calls it can just call RaiseActivating.

I've changed my mind on this. I went through the process of removing OnMouseClick/MouseClick and OnActivating/Activating CAN replace it, but in some cases it's pretty inconvenient. So I'm leaving it in but making the API docs more clear.

Originally posted by @tig in #4167

I've changed my mind again. As of right now,

Fixes this and removes OnMouseClick/MouseClick!

It took a bit of work but I got it done and it makes me happy as it's definitely a simplifier for the overall API.

One of the nuanced reasons I like this is any new developer looking at the library, coming from a traditional GUI world, might be looking for a "click" event. And previously they'd find it. But for TUI apps, where the KEYBOARD is the more important modality, devs are much better off using KeyBindings and MouseBindings for most scenarios.

Now, they'll be led down that path more naturally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions