Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event handling in stack example #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tpoliaw
Copy link

@tpoliaw tpoliaw commented Jul 6, 2022

A few minor (imo) improvements for the stack example.

  • React to the right mouse events
  • Resize the layout when the terminal is resized
  • Clear the background so top window blocks out windows behind it
  • Reorder the message printing so previous message is not visible behind new message

Happy to rework if you'd like it done differently (or not at all).

The help text in the stack example suggests clicking on the windows but
this did not do anything as raw click events were expected while the
terminal was not in raw mouse event mode.

Let the model respond to the SingleClick event instead of the MousePress
so click messages are shown.

Rearrange the print order and clear the background of widgets so that the
borders of the widgets in the lower stack are not shown through and the
end of the previous click message does not remain showing when the next
click is registered.

This combined with listening to resize events also allows the layout to
remain consistent when the terminal is resized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant