-
Notifications
You must be signed in to change notification settings - Fork 86
uiform register legacy
uiform-register-legacy registers a new display element using legacy syntax, which is compatible with the function calls used in all modules/ln_glgui widgets.
Parameter | Description |
---|---|
name | Display element name |
draw | Function called when element is drawn: (lambda (gui wgt) ...) |
input | Function called when element is clicked: (lambda (gui wgt type mx my) ... ) |
All fields other than x, y, w,
and h
that could be queried during the draw or input functions must be supplied when declaring an instance of the newly registered element. The best practice is to look in the initialization code for the glgui
element that you are registering, and supply a value for every field, including those that are normally created by default.
Example 1: Reuse the (glgui-box g x y w h c) widget as a uiform element, and call it. Note that the color argument is NOT optional in this case and will cause a segfault if omitted.
(uiform-register-legacy 'box glgui:box-draw glgui:box-input)
(box color ,Red)
Example 2: Reuse the (glgui-label g x y w h label fnt color . bgcolor) widget as a uiform element and enable copy, paste, and cursor movement. Note that all fields created in (glgui-label) must be supplied, not just label, fnt, and color.
(uiform-register-legacy 'myText glgui:label-draw glgui:label-input)
(myText
old-mx #f
old-my #f
rounded #f
font ,ascii_18.fnt
label "Registered Legacy Label"
callback #f
aftercharcb #f
onfocuscb #f
armed #f
longpress (#f #f 0)
longpress-range 10
longpress-duration 0.5
longpress-callback ,glgui:label-copypaste-overlay
copyable? #t
pastable? #t
color ,White
hidden #f
direction ,GUI_LEFTTORIGHT
password #f
enableinput #t
focus #f
focuspos 0
clearoninput #f
showstart #f
bgcolor #f
align ,GUI_ALIGNCENTER
draw-handle ,glgui:label-draw
input-handle ,glgui:label-input
update-handle ,glgui:label-update
)
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip