run script on startup; new button to switch to source editor
Dependencies
- [2]
7D7J5J4Xappend errors to output buffer - [3]
RJPNFXVQnew fork: a personal dashboard for mobile devices - [4]
LRG2TNA7screens now run - [5]
URM35DJSrip out the canvas - [6]
5MEJ7XNHlay out buttons based on device dimensions - [7]
I52S4E5Frunning `print` now appends to output editor - [8]
HVXZLNCCsend errors from event handlers to output editor - [9]
OGDDLU5Bclose all menus when tapping any button - [10]
W4EQ6IW4simplify state management for menus - [11]
PN6VP3LVescape hatch when print is overridden - [12]
GWLETNMWMike's suggested button layout - [13]
5OCELN37bugfix in output editor wrapping - [14]
GVX7YSQYinitial script after splitting up text-zoom - [15]
W3RRTO4Pextract a second helper for buttons - [16]
GAKJROFZahh, got the background color sliders working - [*]
R5QXEHUIsomebody stop me - [*]
ZM7NOBRMnew fork: carousel shell - [*]
SIASJPGRsave the list of open files across restart
Change contents
- replacement in screens/widgets at line 3
-- button to invoke add_editor-- button to add a text box - replacement in screens/widgets at line 7
rect('line', Safe_width-65, Menu_bottom+5, 30,30, 5)line(Safe_width-60, Menu_bottom+20, Safe_width-40, Menu_bottom+20)line(Safe_width-50, Menu_bottom+10, Safe_width-50, Menu_bottom+30)rect('line', Safe_width-115, 5, 30,30, 5)line(Safe_width-110, 20, Safe_width-90, 20)line(Safe_width-100, 10, Safe_width-100, 30) - replacement in screens/widgets at line 12
return x2 >= Safe_width-65 and y2 <= Menu_bottom+35return x2 >= Safe_width-120 and x2 <= Safe_width-85 and y2 <= 40 - edit in screens/widgets at line 16[5.456]
-- button to stop the app and return to the source editortable.insert(widgets, {draw = function()color(0, 0.6,0.6)g.setFont(Font)local s = App.width('exit')rect('line', Safe_width-s-15, 75, s+10,30, 5)g.print('exit', Safe_width-s-10, 80)end,ispress = function(x2,y2)g.setFont(Font)local s = App.width('exit')return x2 >= Safe_width-s-15 and y2 >= 75 and y2 <= 105end,press = stop_app,}) - edit in screens/main at line 9
color(0, 0.6,0.6)line(Safe_width-120, 0, Safe_width-120, 40)g.setFont(Font)local s = App.width('exit')line(Safe_width-120, 40, Safe_width-s-20, 40)line(Safe_width-s-20, 40, Safe_width-s-20, 110)line(Safe_width-s-20, 110, Safe_width+100, 110) - file addition: 0161-stop_app[18.2]
stop_app = function()clear_handlers()Show_code = trueend - file addition: 0160-run_app[18.2]
run_app = function()-- ## run: initializeclear_handlers()edit.clear(Current_pane.output_editor_state)print = print_to_output-- ## runlocal error = eval_all()-- ## run: save some stuff, clean up the restif error == nil thenShow_code = nilelseprint = Real_printclear_handlers()-- could be either output or errortable.insert(Current_pane.output_editor_state.lines, {data=tostring(error)})endif #Current_pane.output_editor_state.lines == 0 thentable.insert(Current_pane.output_editor_state.lines, {data=''})endText.redraw_all(Current_pane.output_editor_state)end - replacement in 0102-send_errors_to_output at line 8
clear_handlers()Show_code = truestop_app() - replacement in 0051-run_button at line 5[5.616]→[5.329:354](∅→∅),[5.804]→[5.329:354](∅→∅),[5.830]→[5.329:354](∅→∅),[5.329]→[5.329:354](∅→∅),[5.354]→[5.1072:1092](∅→∅),[5.1092]→[5.354:463](∅→∅),[5.354]→[5.354:463](∅→∅),[5.43]→[5.1093:1141](∅→∅),[5.795]→[5.795:835](∅→∅),[5.835]→[4.765:793](∅→∅),[4.793]→[5.876:925](∅→∅),[5.1193]→[5.876:925](∅→∅),[5.876]→[5.876:925](∅→∅),[5.925]→[4.794:890](∅→∅),[4.890]→[5.990:1029](∅→∅),[5.990]→[5.990:1029](∅→∅),[5.1029]→[4.891:972](∅→∅),[4.972]→[5.1111:1302](∅→∅),[5.1111]→[5.1111:1302](∅→∅)
-- ## run: initializeclear_handlers()local buf = table.concat(map(Current_pane.editor_state.lines, function(line) return line.data end), '\n')edit.clear(Current_pane.output_editor_state)print = print_to_output-- ## runlocal error = eval_all()-- ## run: save some stuff, clean up the restif error == nil thenShow_code = nilelseprint = Real_printclear_handlers()-- could be either output or errortable.insert(Current_pane.output_editor_state.lines, {data=tostring(error)})endif #Current_pane.output_editor_state.lines == 0 thentable.insert(Current_pane.output_editor_state.lines, {data=''})endText.redraw_all(Current_pane.output_editor_state)run_app() - edit in 0011-on.initialize at line 22[20.1180][3.173]
run_app()