Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

glgui-battery adds a battery icon to the screen (without callback, i.e. not clickable). It changes it colors at predefined levels: yellow at <50% and red at <25%, and warning at <10%

Parameter Description
g The Graphical User Interface (GUI) this widget belongs to
x Lower left corner along the x-axis in pixels
y Lower left corner along the y-axis in pixels
w Width of the element in pixels
h Height of the element in pixels
v Specifies the battery filling value in percent

Example

Example 1: Place a battery symbol at x=10, y=400, which is 40% full, thereby yellow

(set! gui:main (make-glgui))
(glgui-battery gui:main 10 400 40 18 40)
Clone this wiki locally