To refine the Maplet application:
1. Add a title to the Maplet application.
2. Change the width.
3. Place the scroll bar on the BoxCell, not on the Table.
4. Change the font and color of the text.
By default, one window is used in the first example. To add a title, the layout must be wrapped in a Window element.
Similarly, the text "Values of the sine function" must be wrapped in a Label element, and the Table element wrapped in a BoxCell element, each with appropriate attributes.
>
|
maplet := Maplet(
# The BoxLayout element structures the Maplet application
# window into three rows. The BowLayout element
# ensures that the rows are equidistant.
Window( 'title' = "The Sine Function", [
Label(
"Values of the sine function:",
'foreground' = COLOR(RGB, 1, 1, 0 ),
'font' = Font("helvetica", 14)
),
BoxCell( 'vscroll' = 'as_needed',
Table( 'width' = 200, ["x", "sin(x)"],
[seq( [evalf[3](i/10), evalf[3](sin(i/10))], i = 0..62 )]
)
),
Button( "OK", Shutdown() )
]
) ):
# Display runs the Maplet application.
Maplets[Display](maplet):
|