Similar to +Obj
, but not editable (view-only). Therefore it is free to display an arbitrary attribute of an object, or even the result of an arbitrary formatting expression, while still allowing to click on it and jump to the object's GUI form, as determined by the url>- method (or a custom method supplied as an optional argument to +ObjView
. Such an optional method is accepted by all subclasses of +obj
)
A common use of +ObjView
is when presenting data in a chart
. Given the following 'put'- function:
'((This) (list This This (: pa) (: ma) (: mate) (: job) (: dat)))
The data can be displayed with the following table:
(<table> 'chart NIL
'((btn) (NIL "Name") (NIL "Father") (NIL "Mother") (NIL "Partner") (NIL "Occupation") (NIL "born"))
(do (cho)
( (alternating)
(gui 1 '(+DstButton) Dst)
(gui 2 '(+ObjView +TextField) '(: nm))
(gui 3 '(+ObjView +TextField) '(: nm))
(gui 4 '(+ObjView +TextField) '(: nm))
(gui 5 '(+ObjView +TextField) '(: nm))
(gui 6 '(+TextField))
(gui 7 '(+DateField)) ) ) )
Columns 2,3 and 4 use +ObjView
to display the name of the 'pa', 'ma' and 'mate' relations of the current object respectively.
See also +Obj, +obj.