peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.62k stars 237 forks source link

Fix #271 - Added Tab sample app #302

Closed dwhall closed 3 years ago

dwhall commented 3 years ago

Issues fixed by this PR

271

What does this implement/fix?

Adds a sample app, does not change any widgets.

Any other comments?

This app demonstrates how to use a row of Buttons to select one of a handful of Frames to show; emulating a Tab page widget.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 97.161% when pulling 35f06c01b36064430511cacdb4e40c309fbd89a0 on dwhall:master into e7152f08f8552b93912621941e8f42ddc5a49fd4 on peterbrittain:master.

peterbrittain commented 3 years ago

Thanks. Now that I see it in action, it makes me realise that this approach is missing a visual cue which "tab" is active. Maybe we could do something to TabButtons to disable the button for the active tab (e.g. pass in the index of the tab to the constructor and disable the button for that index)?

dwhall commented 3 years ago

Disabling the active tab is not only a good visual indicator, it makes for one fewer button presses when navigating the tabs (nice side-effect).

peterbrittain commented 3 years ago

Nice!