2020-01-17 11:43:26 +00:00
/ * r u n w i d g e t s i n t h e i r o w n f u n c t i o n s c o p e s o t h e y d o n ' t i n t e r f e r e w i t h
currently - running apps * /
2019-11-15 17:15:49 +00:00
( ( ) => {
2020-02-07 17:09:18 +00:00
function draw ( ) {
2020-02-13 11:47:59 +00:00
g . reset ( ) ; // reset the graphics context to defaults (color/font/etc)
2020-05-23 20:51:24 +00:00
// add your code
2020-03-05 13:15:27 +00:00
g . drawString ( "X" , this . x , this . y ) ;
2020-02-07 17:09:18 +00:00
}
2020-01-17 11:43:26 +00:00
2020-02-07 17:09:18 +00:00
// add your widget
2020-03-05 13:15:27 +00:00
WIDGETS [ "mywidget" ] = {
2022-06-16 12:39:31 +00:00
area : "tl" , // tl (top left), tr (top right), bl (bottom left), br (bottom right), be aware that not all apps support widgets at the bottom of the screen
2020-03-05 13:15:27 +00:00
width : 28 , // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout
draw : draw // called to draw the widget
} ;
2020-01-17 11:43:26 +00:00
} ) ( )