Skip to content

Instantly share code, notes, and snippets.

@aallan

aallan/widget.js

Created Dec 5, 2019
Embed
What would you like to do?
Additional code to add widgets into a Bangle.js application when using the Web IDE. Needs to be included at the top of your code.
var WIDGETPOS={tl:32,tr:g.getWidth()-32,bl:32,br:g.getWidth()-32};
var WIDGETS={};
function drawWidgets() { for (var w of WIDGETS) w.draw(); }
require("Storage").list().filter(a=>a[0]=='=').forEach(widget=>eval(require("Storage").read(widget)));
setTimeout(drawWidgets,100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment