Creating pages
By themselves, notebook widgets do not offer much of an interface to users. To present a useful interface to users, notebooks must contain pages (EwPage). Pages are created by sending one of the following messages to either a PM or WIN notebook:
createPage:argBlock:
Creates a new page within the receiver and adds it to the end of the receiver's collection of pages. The first argument is the widget name for the new page, the second is its argument block.
createPage:argBlock:before:
Creates a new page within the receiver before an existing page within the receiver. The last argument is the page that the new page is to precede.
createPage:argBlock:sharingWith:
Creates a new page that shares widgets with another page in the receiver. The last argument is the page that defines the widgets shared by itself and the new page.
createPage:argBlock:before:sharingWith:
Creates a new page within the receiver that shares widgets with another page. The new page is inserted before a page already within the receiver.
The following expression adds a page with a tab labeled "Top Page" to a notebook:
topPage := notebook
createPage: 'envinfo_page'
argBlock: [:w |
"Note: The tab label can be any renderable."
w tabLabel: 'Top Page'].
topPage manageChild.
Use createPage:argBlock:sharingWith: if many pages of a notebook are to display different information in the same way; that is, each page will contain the same widgets but with different information (for example, an address book). This will save both the number of widgets needed and the speed of opening a notebook.
Tip:
Pages only appear in the notebook if they are managed. To temporarily hide a page in a notebook without destroying the page widget, use the unmanageChild message.
Last modified date: 01/29/2015