Skip to content
Matthias Görges edited this page Apr 15, 2016 · 2 revisions

glgui-container provides a minimal container widget. Other widgets need to be added to it to make it useful. It can be used instead of the gui parameter when creating and referring other widgets.

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

Attributes

Besides the parameters set in the above procedure, the widget has the following attributes that can be set using glgui-widget-set! and retrieved using glgui-widget-get:

Attribute Default Value Description
draggable_x? #f Allow container to be dragged horizontally.
draggable_y? #f Allow container to be dragged vertically.
drag_keep 10 Minimum (in px) of container that must remain on screen when dragged.

Example

Example1: Make a login container with a numeric keypad and pin entry string. Finally hide the entire container group.

(set! gui:numpad (glgui-container gui 10 10 280 170))
(glgui-box gui:numpad 0 0 280 170 Grey)
(set! gui:numpad:keypad (glgui-keypad gui:numpad 0 0 280 140 fnt_24.fnt keypad:numeric))
(glgui-label gui:numpad 0 140 175 25 "Pin:" fnt_24.fnt White)
(set! gui:numpad:label (glgui-label gui:numpad 175 145 150 0 "" fnt_24.fnt White))
(glgui-widget-set! gui:numpad gui:numpad:label 'focus #t)
;; Try with the next line commented and without.
(glgui-widget-set! gui gui:numpad 'hidden #t)
Clone this wiki locally