Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BuildingUI.md - Form asElement to create the back #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions Chapters/BuildingUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,14 @@ BlElement << #MGCardElement
```

We redefine the `initialize` method to create the `backElement` as well as adding a layout for
placement of the children of the `MGCardElement` instances.
placement of the children of the `MGCardElement` instances.
We use the method `asElement` on the cardback `Form` to quicly create a BlElement with the png as a background and the size equal to the png size.


```
MGCardElement >> initialize
super initialize.
backElement := BlElement new
background: self class cardbackForm;
size:self cardExtent;
yourself.
backElement := self class cardbackForm asElement.
self size: self cardExtent.
self layout: BlLinearLayout new alignCenter.
self background: self backgroundPaint.
Expand All @@ -193,10 +191,7 @@ MGCardElement >> initialize
In the following added part:

```
backElement := BlElement new
background: self class cardbackForm;
size:self cardExtent;
yourself.
backElement := self class cardbackForm asElement.
frontElement := BlTextElement new.
```

Expand All @@ -222,10 +217,7 @@ We extract the back element creation in its own method `initializeBackElement`.

```
MGCardElement >> initializeBackElement
backElement := BlElement new
background: self class cardbackForm;
size: self cardExtent;
yourself
backElement := self class cardbackForm asElement
```

```
Expand Down