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

glgui-widget-set! sets a parameter of a widget

Parameter Description
g Graphical User Interface (GUI) the widget is part of
w The widget for which a parameter is to be changed
id The desired parameter of the widget to be changed
val The new value of parameter id

Example

Example from HelloWorld. Toggle the widget color of widget1 between white and red

(define (button-callback g w t x y)
  (glgui-widget-set! g w 'color (if (= (glgui-widget-get g w 'color) White) Red White)))
(set! gui (make-glgui))
(let ((bw 150) (bh 50) 
      (bx (/ (- (glgui-width-get) bw) 2.)) (by (/ (- (glgui-height-get) bh) 2.)))
  (glgui-button-string gui bx by bw bh "Me too!!!" ascii_18.fnt button-callback))
Clone this wiki locally