From 1418e1b9dc41d8f69bccb8de0fe0f1fb6835ce11 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 26 Feb 2018 22:54:39 -0500 Subject: Split UI library and widgets --- lib/ui/drawable.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/ui/drawable.go (limited to 'lib/ui/drawable.go') diff --git a/lib/ui/drawable.go b/lib/ui/drawable.go new file mode 100644 index 0000000..ef09451 --- /dev/null +++ b/lib/ui/drawable.go @@ -0,0 +1,10 @@ +package ui + +type Drawable interface { + // Called when this renderable should draw itself + Draw(ctx *Context) + // Specifies a function to call when this cell needs to be redrawn + OnInvalidate(callback func(d Drawable)) + // Invalidates the drawable + Invalidate() +} -- cgit v1.2.3