Entry Objects

Objects of type Entry are displayed as text entry boxes that can be edited by the user of the program. Entry objects support the generic graphics methods move(), draw(graphwin), undraw(), setFill(color), and clone(). The Entry specific methods are given below.

Entry(centerPoint, width)
Constructs an Entry having the given center point and width. The width is specified in number of characters of text that can be displayed.

Example: inputBox = Entry(Point(3,4), 5)

Returns a clone of the point where the entry box is centered.

Example: centerPoint = inputBox.getAnchor()

Returns the string of text that is currently in the entry box.

Example: inputStr = inputBox.getText()

Sets the text in the entry box to the given string.

Example: inputBox.setText("32.0")

Changes the font face to the given family. Possible values are "helvetica", "courier", "times roman", and "arial".

Example: inputBox.setFace("courier")

Changes the font size to the given point size. Sizes from 5 to 36 points are legal.

Example: inputBox.setSize(12)

Changes font to the given style. Possible values are: "normal", "bold", "italic", and "bold italic".

Example: inputBox.setStyle("italic")

Sets the color of the text to color.

Example: inputBox.setTextColor("green")

zelle 2016-08-26