Created Panel and PanelContainer untested code

This commit is contained in:
Luke I. Wilson
2021-04-05 16:22:40 -05:00
parent ccb096a3f6
commit 03c8c3bcad
3 changed files with 361 additions and 2 deletions

View File

@@ -15,8 +15,8 @@ type Component interface {
// A component knows its position and size, which is used to draw itself in
// its bounding rectangle.
Draw(tcell.Screen)
// Components can be focused, which may affect how it handles events. For
// example, when a button is focused, the Return key may be pressed to
// Components can be focused, which may affect how it handles events or draws.
// For example, when a button is focused, the Return key may be pressed to
// activate the button.
SetFocused(bool)
// Applies the theme to the component and all of its children.
@@ -35,5 +35,7 @@ type Component interface {
// used, instead.
SetSize(int, int)
// It is good practice for a Component to check if it is focused before handling
// events.
tcell.EventHandler // A Component can handle events
}