dlMakeDisplayList
dlMakeDisplayList( ) =>w_displayList/nil
Description
Creates an empty display list you can add objects to.
Value Returned
Examples
Creates a display list to draw inside a window and to use as its icon.
/* First, make the DisplayList. */
dl = dlMakeDisplayList( )
/* Now make a pen table for it. */
penTable = dlMakePenTable(5)
/* Assign the penTable to the display list. */
dlSetPenTable( dl penTable)
/* Define a couple of colors. */
colorIndex = hiStringToIcon( nameToColor( "blue"))
dlSetPenColor( 1 colorIndex penTable)
/* Set this pen "filled." */
dlSetPenFillStyle( 1 "SolidFill" penTable)
/* Put the objects in. */
dlAddBox( dl 1 0:0 100:100)
dlAddBox( dl 2 10:10 90:90)
dlAddCircle( dl 3 50:50 20)
dlAddStrokeText( dl 4 50:50 "Window" "0" "gothic" 25 "center")
/* Make a window. Put the DisplayList into the window */
/* and set the window’s icon. */
w = hiOpenWindow( )
dlAttachDlistToWindow( dl w)
/* Convert the dlist to an icon. */
icon = dlDlistToIcon( dl 50 50)
hiSetWindowIcon( w icon)
/* Save it to a file. */
dlSaveDlist( dl "save.dlist" "newDl")
/* Try resizing the window. The dlist will fit inside it. */
/* Iconify the window. */
Related Topics
Add Objects to the Display List
Return to top