I am developing a UI button in pForth which has the following attributes:
\ Button data structure
:struct button
ubyte type
ubyte x
ubyte y
ubyte width
ubyte height
ubyte radius
aptr text
ubyte flags
ushort buttonColor
ushort borderColor
ushort textColor
aptr callback
;struct
which I have defined in this structure. I would now like to create a button creation word that would parse the button's name from the input stream and return a pointer to the button structure so I could get/set attributes using s@ and s!.
How would one code this?