glgui box dragable - part-cw/lambdanative GitHub Wiki
(glgui-box-dragable g x y w h color cb)
glgui-box-dragable is a special version of glgui-box. It plots a dragable filled rectangle (with callback).
Parameter | Description |
---|---|
g | Graphical User Interface (GUI) for this widget |
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 |
c | Color, with which the box is filled |
cb | Specifies callback procedure that is executed when box is dragged |
Example
Example 1: Make a dragable black square, which when dragged displays the amount in x direction it was moved by. It fills most of the screen width and is approximately half way down an iOS screen.
(set! gui:waves (make-glgui))
(define (wave-canvas-callback g w t x y) (display (glgui-widget-get g w 'offsetx)))
(glgui-box-dragable gui:waves 5 (- (glgui-height-get) 295) (- (glgui-width-get) 10) (+ 295 20) Black wave-canvas-callback)