about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-12 13:40:53 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-12 13:40:53 -0700
commit094f3bd7e89ada36ddef8845770de21e71977954 (patch)
tree30ad27082be303347e93ae95ed0baaefbbb5f4a1
parent9b49c8da7725a9ec53bb594674f304f2b4681a6a (diff)
downloadview.love-094f3bd7e89ada36ddef8845770de21e71977954.tar.gz
button framework is at the app level
-rw-r--r--edit.lua3
-rw-r--r--main.lua4
2 files changed, 4 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua
index c2a6a90..dee5334 100644
--- a/edit.lua
+++ b/edit.lua
@@ -13,7 +13,6 @@ Help_background_color = {r=0, g=0.5, b=0, a=0.1}
 utf8 = require 'utf8'
 
 require 'file'
-require 'button'
 require 'text'
 require 'drawing'
 require 'geom'
@@ -112,8 +111,6 @@ Cursor_time = 0
 end  -- App.initialize_globals
 
 function edit.draw()
-  Button_handlers = {}
-
   App.color(Text_color)
 --?   print(Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos)
   assert(Text.le1(Screen_top1, Cursor1))
diff --git a/main.lua b/main.lua
index 6a4e30c..c9c5142 100644
--- a/main.lua
+++ b/main.lua
@@ -2,12 +2,15 @@ utf8 = require 'utf8'
 
 require 'app'
 require 'test'
+
 require 'keychord'
+require 'button'
 
 require 'main_tests'
 
 -- delegate most business logic to a layer that can be reused by other projects
 require 'edit'
+Editor_state = {}
 
 -- called both in tests and real run
 function App.initialize_globals()
@@ -136,6 +139,7 @@ function App.filedropped(file)
 end
 
 function App.draw()
+  Button_handlers = {}
   edit.draw()
 end