CS3283-CodeCraft/CodeCraft — pull request #9 by Tiotao (2014-11-03 13:45:46+00:00)
Title: include a lib button below stage

demostrates how to create a push botton at given location and how to customise dialog box (with background image)

#### Create Button

Button can be created by creating a `PushButtonMorph`, see `line 1274` in `gui.js`
```
newButton = new PushButtonMorph(target, action, ...);
```

#### Create Button Action

All button actions are method in `IDE_Morph` class, to create new action:
```
IDE_Morph.prototype.newFunction= function(){...}
```
When a button is created, the constructor requires an action string. The string is the method name that we defined previously, for example
```
newbutton = new PushButtonMorph( this, "newFunction", ...)
```
See `line 1274` and `line 1850`in `gui.js`

#### Create Dialog Box
In `openLibrary` method, a dialog box is created via `var db = new DialogBoxMorph()`. A DialogBoxMorph contains `inform` method, which prompt the dialog box with an OK button. See `line 1866`

#### Insert Image
Image may be inserted into dialog box or any similar frame by common canvas operation. See `line 1852`. For more information about canvas operation, please see [this](http://www.w3schools.com/html/html5_canvas.asp)