From 03144e64690964c2831393099f1a9c35115e3420 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 27 Nov 2020 23:07:40 -0500 Subject: [PATCH] Update instructions in CHANGELOG. --- CHANGELOG.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1ad25..fbb06a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking API changes -- The `widgetapi.Widget.Keyboard` and `widgetapi.Widget.Mouse` method now +- The `widgetapi.Widget.Keyboard` and `widgetapi.Widget.Mouse` methods now accepts a second argument which provides widgets with additional metadata. - This affects all implemented widgets. + All widgets implemented outside of the `termdash` repository will need to be + similarly to the `Barchart` example below. Change the original method + signatures: + ```go + func (*BarChart) Keyboard(k *terminalapi.Keyboard) error { ... } + + func (*BarChart) Mouse(m *terminalapi.Mouse) error { ... } + + ``` + + By adding the new `*widgetapi.EventMeta` argument as follows: + ```go + func (*BarChart) Keyboard(k *terminalapi.Keyboard, meta *widgetapi.EventMeta) error { ... } + + func (*BarChart) Mouse(m *terminalapi.Mouse, meta *widgetapi.EventMeta) error { ... } + ``` ### Added