# Print (of `Object`)

class `Print`

  Defined in Print.sc.

  The Print class lets you show text, buttons and images in a GUI on screen.

  It is generally used as a static class, in the sense that you call methods on Print directly without making an instance of it. The init: method then displays the dialog.

  Example usage:

      (Print
              addTitle: "This is the title"
              font: 0
              width: 90
              addText: "Enter new font number:"
              addEdit: @temp0 6 0 24
              addButton: 0 "A button!" 0 12
              init:
      )

## Properties

Inherited from `Object`:

Property | Description
--- | ---
name |

Defined in Print:

Property | Description
--- | ---
dialog |
window |
title | The dialog title.
mode | Default alignment: alLEFT, alCENTER or alRIGHT.
font |
width |
x |
y |
ticks |
caller |
retValue |
modeless |
first |
saveCursor |

## Methods

`init`([theCaller text])

  Calls showSelf() to show the dialog.

  Parameters: | theCaller (heapPtr) – An optional object with a cue method. text (string) – Optional text that is added to the dialog.
  Returns: | If a button was pressed, returns the value of that button.

`doit`()

`dispose`()

`showSelf`()

  Shows the dialog. Generally, you should use the init() method to show the dialog.

`addButton`(theValue noun verb cond seq [x y modNum])

`addButton`(theValue text [x y])

  Adds a button to the dialog, either with the supplied text or a message resource.

  Parameters: | theValue (number) – A numerical value associated with the button. This value will be returned by the dialog if the button is pressed. text (string) – The button text. x (number) – The button x offset from the upper left of the dialog. y (number) – The button y offset from the upper left of the dialog. noun (number) – The noun of the message to show. verb (number) – The verb of the message to show. cond (number) – The condition of the message to show. seq (number) – The sequence of the message to show, or 0. modNum (number) – Optional room number of the message to show (if not specified, the current room is used).

`addColorButton`(theValue noun verb cond seq [x y modNum normalForeColor highlightForeColor selectedForeColor normalBackColor highlightBackColor selectedBackColor])

`addColorButton`(theValue text [x y normalForeColor highlightForeColor selectedForeColor normalBackColor highlightBackColor selectedBackColor])

  This is similar to addButton, but lets you specify up to 6 color indices for various parts and states of the button.

  Parameters: | theValue (number) – A numerical value associated with the button. This value will be returned by the dialog if the button is pressed. text (string) – The button text. x (number) – The button x offset from the upper left of the dialog. y (number) – The button y offset from the upper left of the dialog. noun (number) – The noun of the message to show. verb (number) – The verb of the message to show. cond (number) – The condition of the message to show. seq (number) – The sequence of the message to show, or 0. modNum (number) – Optional room number of the message to show (if not specified, the current room is used).

`addEdit`(buffer maxLength [x y initialText])

  Adds an edit control to the dialog.

  Parameters: | buffer (string) – The buffer that will receive the text. maxLength (number) – The length of the buffer. x (number) – The edit control x offset from the upper left of the dialog. y (number) – The edit control y offset from the upper left of the dialog. initialText (string) – Text to initialize the edit control.

`addIcon`(view loop cel [x y])

  Adds an icon to the dialog.

`addText`(noun verb cond seq [x y modNum])

`addText`(text [x y])

  Adds text to the dialog, either with the supplied string or a message resource.

  Parameters: | text (string) – The text. x (number) – The text x offset from the upper left of the dialog. y (number) – The text y offset from the upper left of the dialog. noun (number) – The noun of the message to show. verb (number) – The verb of the message to show. cond (number) – The condition of the message to show. seq (number) – The sequence of the message to show, or 0. modNum (number) – Optional room number of the message to show (if not specified, the current room is used).

`addTextF`(params)

  Adds formatted text to the dialog. There are no options for positioning or getting the text from a message resource.

`addTitle`(noun verb cond seq [modNum])

`addTitle`(text)

  Adds a title to the dialog, either with the supplied string or a message resource.

  Parameters: | text (string) – The title text. noun (number) – The noun of the message to show. verb (number) – The verb of the message to show. cond (number) – The condition of the message to show. seq (number) – The sequence of the message to show, or 0. modNum (number) – Optional room number of the message to show (if not specified, the current room is used).

`posn`(theX theY)

  Positions the dialog on screen.

`handleEvent`(pEvent)

`cue`()