Previous: actor methods, Up: MINOS2 object framework [Contents][Index]
widget
methods:parent-w
( – optr ) minos2
pointer to parent widget
act
( – optr ) minos2
pointer to actor
name$
( – addr u ) minos2 “name-string”
Widget name for debugging and searching
x
( – r ) minos2
widget x coordinate
y
( – r ) minos2
widget y coordinate
w
( – r ) minos2
widget width
h
( – r ) minos2
widget height above baseline
d
( – r ) minos2
widget depth below baseline
gap
( – r ) minos2
gap between lines
baseline
( – r ) minos2
minimun skip per line
kerning
( – r ) minos2
add kerning
raise
( – r ) minos2
raise/lower box
border
( – r ) minos2
surrounding border, all directions
borderv
( – r ) minos2
vertical border offset
bordert
( – r ) minos2
top border offset
borderl
( – r ) minos2
left border offset
w-color
( – r ) minos2
widget color index (into color map), if any
draw-init
( – ) minos2
init draw
draw
( – ) minos2
draw widget
split
( firstflag rstart1 rx – o rstart2 ) minos2
split a widget into parts for typesetting paragraphs
lastfit
( – ) minos2
fit last widget element in a box
hglue
( – rtyp rsub radd ) minos2
calculate horizontal glue
dglue
( – rtyp rsub radd ) minos2
calculate vertical glue below baseline
vglue
( – rtyp rsub radd ) minos2
calculate vertical glue above baseline
hglue@
( – rtyp rsub radd ) minos2 “hglue-fetch”
cached variant of hglue
dglue@
( – rtyp rsub radd ) minos2 “dglue-fetch”
cached variant of dglue
vglue@
( – rtyp rsub radd ) minos2 “vglue-fetch”
cached variant of vglue
xywh
( – rx0 ry0 rw rh ) minos2
widget bounding box, starting at the top left corner
xywhd
( – rx ry rw rh rd ) minos2
widget bounding box, starting at the left baseline point
!resize
( rx ry rw rh rd – ) minos2 “store-resize”
resize a widget
!size
( – ) minos2 “store-size”
let the widget self-determine its size
dispose-widget
( – ) minos2
get rid of a widget
.widget
( – ) minos2 “print-widget”
debugging: Print informations about the widget
par-split
( rw – ) minos2
split a paragraph by width rw
resized
( – ) minos2
widget is resized
Components are composed using a boxes&glue model similar to LaTeX, including paragraph breaking. For the sake of simplicity and portability, MINOS2 only supports a single window, and uses OpenGL for rendering.
MINOS2 furthermore supports animations with the animation
class.
A color index texture is used for different color schemes, and
transition between neighboring schemes can also be animated.
>animate
( rdelta addr xt – ) minos2 “to-animate”
create a new animation, calling xt with stack effect
( addr r0..1 -- )
repeatedly, until the rdelta timeout
expired; last call is always with argument 1e for the time.
You can create named color indexes and assign them color values for the currently active color scheme.
color:
( rgba "name" – ) minos2 “color-colon”
Create a (possibly shared) color index initialized with rgba
new-color:
( rgba "name" – ) minos2 “new-color-colon”
Create a unique color index initialized with rgba
text-color:
( rgba "name" – ) minos2 “text-color-colon”
Create a unique text color index initialized with rgba, the corresponding emoji color is set to white.
text-emoji-color:
( rgbatext rgbaemoji "name" – ) minos2 “text-emoji-color-colon”
Create a unique text color index initialized with rgbatext, the corresponding emoji color is set to rgbaemoji.
fade-color:
( rgba1 rgba2 "name" – ) minos2 “fade-color-colon”
Create a unique pair of text color index initialized with rgba1 and rgba2, the corresponding emoji color is set to white. By slowly shifting the index from one to the next index, the object will shift its color using a linear interpolation when redrawn.
text-emoji-fade-color:
( rgbatext1 ~2 rgbaemoji1 ~2 "name" – ) minos2 “text-emoji-fade-color-colon”
Create a unique pair of text color index initialized with rgbatext1 and ~2, the corresponding emoji color pair is set to rgbaemoji1 to ~2. By slowly shifting the index from one to the next index, the object will shift its color using a linear interpolation when redrawn.
re-color
( rgba "name" – ) minos2
assign the named color index "name" in the current color scheme with the value rgba.
re-text-color
( rgba "name" – ) minos2
assign the named text color index "name" in the current color scheme with the value rgba.
re-emoji-color
( rgbatext rgbaemoji "name" – ) minos2
assign the named text and emoji color index "name" in the current color scheme with the value rgbatext and rgbaemoji.
re-fade-color
( rgba1 rgba2 "name" – ) minos2
assign the named color index pair "name" in the current color scheme with the value rgba1 and rgba2.
re-text-emoji-fade-color
( rgbatext1 ~2 rgbaemoji1 ~2 "name" – ) minos2
assign the named color index pair "name" in the current color scheme with the value rgbatext1 and ~2 resp. rgbaemoji1 and ~2.
For a number of specific objects, there are early bound methods, that only work on these objects
vp-top
( o:vp – ) minos2
scroll viewport to top
vp-bottom
( o:vp – ) minos2
scroll viewport to bottom
vp-left
( o:vp – ) minos2
scroll viewport to left
vp-right
( o:vp – ) minos2
scroll viewport to right
vp-reslide
( o:vp – ) minos2
Adjust the sliders of a viewport after scrolling
vp-needed
( xt – ) minos2
collect needs in viewport’s vp-need
Previous: actor methods, Up: MINOS2 object framework [Contents][Index]