Skip to content

Instantly share code, notes, and snippets.

@aallan
Created December 5, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aallan/f1170a6717d8bea50cdc5edddc009d24 to your computer and use it in GitHub Desktop.
Save aallan/f1170a6717d8bea50cdc5edddc009d24 to your computer and use it in GitHub Desktop.
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