| |   |
| 33 | 33 | %Then we need a cookbook of how to do simple things in Morphic. |
| 34 | 34 | %The observer pattern and its implementation with changed: and update: messages could go here. Or in ``Idiomatic design patterns'' later.} |
| 35 | 35 | |
| 36 | | \indmain{Morphic} is the name given to \sq's graphical interface. |
| 37 | | Morphic is written in \st, so it is fully portable between operating systems; as a consequence, \sq looks exactly the same on Unix, MacOS and Windows. |
| 38 | | What distinguishes Morphic from most other user interface toolkits is that it does not have separate modes for ``composing'' and ``running'' the interface: all the graphical elements can be assembled and disassembled by the user, at any time.\footnote{We thank Hilaire Fernandes for permission to base this chapter on his original article in French.} |
| 36 | \indmain{Morphic} é o nome dado à interface gráfica do \sq. |
| 37 | O Morphic é escrito em \st, e, sendo assim, é totalmente portável entre os sistemas operacionais onde o \sq roda; como conseqüência, o \sq tem a mesma aparência no Unix, Mac e Windows. |
| 38 | O que distingue o Morphic da maioria das outras bibliotecas de interface é que ele não possui modelos separados para ``composição'' e ``execução'': todos os elementos gráficos pode ser montados e desmontados pelo usuário, a qualquer momento.\footnote{Agradecemo a Hilaire Fernandes pela permissão de basear esse capítulo em seu original em francês}. |
| 39 | 39 | |
| 40 | | \ab{After the first printing, I took an editing pass, correcting some errors and grammatical infelicities.} |
| 41 | | |
| 42 | | \on{I have commented out the LabelstickerMorph and PyramidMorph examples, as they do not really add much over the other examples we have already. The source code is now available in the example subdirectory, in case someone would like to try and use them after all.} |
| 40 | \on{Comentei os exemplos de LabelstickerMorph e PyramidMorph examples, já que eles não adicionam muito aos exemplos que temos. O código fonte está no sub-diretório de exemplo caso alguém queria usá-los para outra coisa.} |
| 43 | 41 | |
| 44 | 42 | %================================================================= |
| 45 | | \section{The history of Morphic} |
| 43 | \section{A história do Morphic} |
| 44 | |
| 45 | O Morphic foi desenvolvido por John Maloney e Randy Smith para a linguagem de programação \ind{Self}, começando por volta de 1993. |
| 46 | Maloney mais tarde escreveu uma versão do Morphic para \sq, mas as idéias básicas da versão em Self ainda estão vivas e saudáveis no Morphic do \sq: \emph{transparência} e \emph{imediatismo}. |
| 46 | 47 | |
| 47 | | Morphic was developed by John Maloney and Randy Smith for the \ind{Self} programming language, staring around 1993. |
| 48 | | Maloney later wrote a new version of Morphic for \sq, but the basic ideas behind the Self version are still alive and well in \sq Morphic: \emph{directness} and \emph{liveness}. |
| 49 | | Directness means that the shapes on the screen are objects that can be examined or changed directly, that is, by pointing at them using the mouse. |
| 50 | | Liveness means that the user interface is always able to respond to user actions: information on the screen is continuously updated as the world that it describes changes. |
| 51 | | A simple example of this is that you can detach a menu item and keep it as a button. |
| 48 | Transparência significa que as formas na tela são objetos que podem ser examinados ou alterados diretamente, isto é, operando sobre os mesmos usando o \foreign{mouse}. |
| 49 | Imediatismo significa que a interface é sempre capaz de responder a ações do usuário: a informação na tela é continuamente atualizada à medida que o mundo que ela descreve muda. |
| 50 | Um exemplo simples disso é que você pode destacar um item de um menu e mantê-lo como um botão. |
| 52 | 51 | |
| 53 | | \dothis{Bring up the world menu. Blue-click once on the world menu to bring up its morphic halo, then blue-click again on the menu item you want to detach to bring up its halo. Now drag that item elsewhere on the screen by grabbing the black handle \grabHandle, as shown in \figref{detachingMenu}.} |
| 52 | \dothis{Abra o \foreign{menu} \foreign{World} e clique com o botão azul sobre o mesmo para acessar o seu halo. Depois, clique sobre um item de \foreign{menu} que você deseja destacar para exibir o halo do mesmo. Agora, arraste esse item para outra posição na tela usando o ícone \grabHandle, como mostrado na \figref{detachingMenu}.} |
| 54 | 53 | \index{Morphic!halo} |
| 55 | 54 | \index{blue button} |
| 56 | 55 | |
| … | … | |
| 57 | 57 | \ifluluelse |
| 58 | 58 | {\centerline{\includegraphics[width=0.6\textwidth]{detachingMenu}}} |
| 59 | 59 | {\centerline{\includegraphics[width=0.4\textwidth]{detachingMenu}}} |
| 60 | | \caption{Detaching a morph, here the \menu{new morph} menu item, to make it an independent button. |
| 60 | \caption{Destacando um \foreign{morph}, aqui o \foreign{menu} \menu{new morph}, e transformando-o em um botão independente. |
| 61 | 61 | \label{fig:detachingMenu}} |
| 62 | 62 | \end{figure} |
| 63 | 63 | |
| 64 | | All of the objects that you see on the screen when you run \sq are \emph{Morphs}, that is, they are instances of subclasses of class \ct{Morph}. |
| 65 | | \mbox{\ct{Morph}} itself is a large class with many methods; this makes it possible for subclasses to implement interesting behaviour with little code. |
| 66 | | You can create a morph to represent any object, although how good a representation you get depends on the object! |
| 64 | Todos os objetos que você vê na tela quando roda o \sq são \emph{Morphs}, isto é, instâncias de subclasses da classe \ct{Morph}. |
| 65 | \mbox{\ct{Morph}} é uma classe grande, com muitos métodos; com isso, suas subclasses podem implementar comportamento bastante interessante com relativamente pouco código. Você pode criar um \foreign{morph} para representar qualquer objeto, embora quão boa a representação vai depender do objeto em si! |
| 67 | 66 | |
| 68 | | \dothis{To create a morph to represent a string object, execute the following code in a workspace, one line at a time.} |
| 67 | \dothis{Para criar um \foreign{morph} que representa um objeto \ct{String}, execute o seguinte código em um \foreign{workspace}, uma linha de cada vez.} |
| 69 | 68 | \begin{code}{} |
| 70 | 69 | s := 'Morph' asMorph openInWorld. |
| 71 | 70 | s openViewerForArgument |
| 72 | 71 | \end{code} |
| 73 | 72 | \cmindex{Morph}{openInWorld} |
| 74 | 73 | |
| 75 | | The first line creates a Morph to represent the string \ct{'Morph'}, and then opens it (that is, displays it) in the ``world'', which is the name that \sq gives to the screen. |
| 76 | | You should obtain a graphical element\,---\,a Morph\,---\,which you can manipulate by blue-clicking. |
| 77 | | The second line opens a ``viewer'' that shows you attributes of this Morph, such as its \ct{x} and \ct{y} coordinates on the screen. Clicking on one of the yellow exclamation marks sends a message to the Morph, which responds appropriately. |
| 74 | A primeira linha criar um \foreign{morph} para representar o texto \ct{'Morph'}, e então o abre (isto é, exibe o mesmo) no ``mundo'', que é o nome que o \sq dá para a tela. |
| 75 | Você obterá um elemento gráfico\,---\,um Morph\,---\,que você pode manipular com o botão azul. |
| 76 | A segunda linha abre um visualizador que mostra atributos do seu \foreign{morph}, como suas coordenadas \ct{x} e \ct{y} na tela. Se você clicar em um dos pontos de exclamação amarelos, uma mensagem é enviada ao objeto, que responderá apropriadamente. |
| 78 | 77 | |
| 79 | | Of course, it is possible to define morphs that are more interesting graphical representations than the one that you have just seen. |
| 80 | | The method \mthind{Object}{asMorph} has a default implementation in class \ct{Object} class that just creates a StringMorph. |
| 81 | | So, for example, \ct{Color tan asMorph} returns a StringMorph labeled with the result of \clsind{Color} \ct{tan printString}. |
| 82 | | Let's change this so that we get a coloured rectangle instead. |
| 78 | Obviamente, é possível definir objetos que são graficamente mais interessantes do que o que você acabou de ver. O método \mthind{Object}{asMorph} tem uma implementação padrão na classe \ct{Object} que cria uma StringMorph. Assim por exemplo, \ct{Color tan asMorph} retorna um StringMorph cujo título é \clsind{Color} \ct{printString}. Vamos mudar isso de modo que obtenhamos um retângulo colorido. |
| 83 | 79 | |
| 84 | | \dothis{Open a browser on the \ct{Color} class and add the following method to it:} |
| 85 | | \begin{method}{Getting a morph for an instance of \ct{Color}.} |
| 80 | \dothis{Abra um navegador na classe \ct{Color} e adicione o seguinte método à mesma:} |
| 81 | \begin{method}{Obtendo um \foreign{morph} para uma instância de \ct{Color}.} |
| 86 | 82 | Color>>>asMorph |
| 87 | 83 | ^ Morph new color: self |
| 88 | 84 | \end{method} |
| 89 | 85 | \noindent |
| 90 | | Now execute \ct{Color orange asMorph} \mthind{Morph}{openInWorld} in a workspace. Instead of the string-like morph, you get an orange rectangle! |
| 91 | | |
| 86 | Agora execute \ct{Color orange asMorph} \mthind{Morph}{openInWorld} em um \foreign{workspace}. Ao invés de um \foreign{morph} representando um texto, você verá um retângulo laranja! |
| 92 | 87 | |
| 93 | 88 | %================================================================= |
| 94 | | \section{Manipulating morphs} |
| 89 | \section{Manipulando \foreign{morphs}} |
| 90 | |
| 91 | \foreign{Morphs} são objetos, e podemos manipulá-los como qualquer objeto em \st: enviando mensagens, mudando suas propriedades, riando novas subclasses de Morph e assim por diante. |
| 95 | 92 | |
| 96 | | Morphs are objects, so we can manipulate them like any other object in \st: by sending messages, we can change their properties, create new subclasses of Morph, and so on. |
| 93 | Cada \foreign{morph}, mesmo aqueles que não abertos da tela no momento, tem uma posição e um tamanho. |
| 94 | Por conveniência, todos os \foreign{morphs} ocupam uma região retangular na tela; se possuem uma forma irregular, sua posição e tamanho são as do menor retângulo capaz de rodeá-los; esse retângulo é conhecido como o retângulo limite do \foreign{morph}. |
| 95 | O método \mthind{Morph}{position} retorna um ponto \ct{Point} que descreve a localização do canto superior esquerdo do \foreign{morph} (ou seja, o canto superior esquerdo de seu retângulo limite). |
| 96 | A origem do sistemas de coordenadas é o canto superior esquerdo da tela, com a coordenada $y$ aumentando para baixo na tela, e a coordenada $x$ aumentando para a direita. |
| 97 | O método \ct{extent} também retorna um ponto, mas esse ponto indica a largura e altura do \foreign{morph} e não a sua localização. |
| 97 | 98 | |
| 98 | 99 | Every morph, even if it is not currently open on the screen, has a position and a size. |
| 99 | 100 | For convenience, all morphs are considered to occupy a rectangular region of the screen; if they are irregularly shaped, their position and size are those of the smallest rectangular ``box'' that surrounds them, which is known as the morph's bounding box, or just its ``bounds''. |
| … | … | |
| 102 | 102 | The origin of the coordinate system is the screen's upper left corner, with $y$ coordinates increasing \emph{down} the screen and $x$ coordinates increasing to the right. |
| 103 | 103 | The \ct{extent} method also returns a point, but this point specifies the width and height of the morph rather than a location. |
| 104 | 104 | |
| 105 | | \dothis{Type the following code into a workspace and \menu{do it}:} |
| 105 | \dothis{Digite o seguinte código em um \foreign{workspace} e execute-o:} |
| 106 | 106 | \begin{code}{} |
| 107 | 107 | joe := Morph new color: Color blue. |
| 108 | 108 | joe openInWorld. |
| … | … | |
| 110 | 110 | bill openInWorld. |
| 111 | 111 | \end{code} |
| 112 | 112 | \noindent |
| 113 | | Then type \ct{joe position} and \menu{print it}. |
| 114 | | To move joe, execute \ct{joe position: (joe position + (10@3))} repeatedly. |
| 113 | Agora digite \ct{joe position} e imprima iso. Para mover \ct{joe}, execute repetidamente \ct{joe position: (joe position + (10@3))}. |
| 115 | 114 | |
| 116 | | It is possible to do a similar thing with size. |
| 117 | | \ct{joe} \mthind{Morph}{extent} answers joe's size; to have joe grow, execute \ct{joe extent: (joe extent * 1.1)}. |
| 118 | | To change the color of a morph, send it the \mthind{Morph}{color:} message with the desired \ct{Color} object as argument, for instance, \ct{joe color: Color orange}. |
| 119 | | To add transparency, try \ct{joe color: (Color orange alpha: 0.5)}. |
| 115 | É possível fazer algo similar com o tamanho: |
| 116 | \ct{joe} \mthind{Morph}{extent} responde o tamanho do objeto; para aumentá-lo, use \ct{joe extent: (joe extent * 1.1)}. |
| 117 | Para mudar a cor de um \foreign{morph}, envie \mthind{Morph}{color:} com a cor desejada como um argumento. Por exemplo, \ct{joe color: Color orange}. |
| 118 | Por fim, para adicionar transparência, use algo como \ct{joe color: (Color orange alpha: 0.5)}. |
| 120 | 119 | |
| 121 | | \dothis{To make bill follow joe, you can repeatedly execute this code:} |
| 120 | \dothis{Para fazer com que \ct{bill} acompanhe \ct{joe}, execute este código repetidamente:} |
| 122 | 121 | \begin{code}{} |
| 123 | 122 | bill position: (joe position + (100@0)) |
| 124 | 123 | \end{code} |
| 125 | 124 | \noindent |
| 126 | | If you move joe using the mouse and then execute this code, bill will move so that it is 100 pixels to the right of joe. |
| 127 | | \ab{It would seem that this would be a good place to introduce the \ct{step} method}. |
| 125 | Se você mover \ct{joe} usando o \foreign{mouse} e então executar o código, verá que \ct{bill} se move para uma posição 100 pixels à direta e \ct{joe}. |
| 128 | 126 | |
| 129 | 127 | %================================================================= |
| 130 | 128 | \section{Composing morphs} |
| toggle raw diff |
--- a/PortugueseBook/Morphic/Morphic.tex
+++ b/PortugueseBook/Morphic/Morphic.tex
@@ -33,24 +33,23 @@
%Then we need a cookbook of how to do simple things in Morphic.
%The observer pattern and its implementation with changed: and update: messages could go here. Or in ``Idiomatic design patterns'' later.}
-\indmain{Morphic} is the name given to \sq's graphical interface.
-Morphic is written in \st, so it is fully portable between operating systems; as a consequence, \sq looks exactly the same on Unix, MacOS and Windows.
-What distinguishes Morphic from most other user interface toolkits is that it does not have separate modes for ``composing'' and ``running'' the interface: all the graphical elements can be assembled and disassembled by the user, at any time.\footnote{We thank Hilaire Fernandes for permission to base this chapter on his original article in French.}
+\indmain{Morphic} é o nome dado à interface gráfica do \sq.
+O Morphic é escrito em \st, e, sendo assim, é totalmente portável entre os sistemas operacionais onde o \sq roda; como conseqüência, o \sq tem a mesma aparência no Unix, Mac e Windows.
+O que distingue o Morphic da maioria das outras bibliotecas de interface é que ele não possui modelos separados para ``composição'' e ``execução'': todos os elementos gráficos pode ser montados e desmontados pelo usuário, a qualquer momento.\footnote{Agradecemo a Hilaire Fernandes pela permissão de basear esse capítulo em seu original em francês}.
-\ab{After the first printing, I took an editing pass, correcting some errors and grammatical infelicities.}
-
-\on{I have commented out the LabelstickerMorph and PyramidMorph examples, as they do not really add much over the other examples we have already. The source code is now available in the example subdirectory, in case someone would like to try and use them after all.}
+\on{Comentei os exemplos de LabelstickerMorph e PyramidMorph examples, já que eles não adicionam muito aos exemplos que temos. O código fonte está no sub-diretório de exemplo caso alguém queria usá-los para outra coisa.}
%=================================================================
-\section{The history of Morphic}
+\section{A história do Morphic}
+
+O Morphic foi desenvolvido por John Maloney e Randy Smith para a linguagem de programação \ind{Self}, começando por volta de 1993.
+Maloney mais tarde escreveu uma versão do Morphic para \sq, mas as idéias básicas da versão em Self ainda estão vivas e saudáveis no Morphic do \sq: \emph{transparência} e \emph{imediatismo}.
-Morphic was developed by John Maloney and Randy Smith for the \ind{Self} programming language, staring around 1993.
-Maloney later wrote a new version of Morphic for \sq, but the basic ideas behind the Self version are still alive and well in \sq Morphic: \emph{directness} and \emph{liveness}.
-Directness means that the shapes on the screen are objects that can be examined or changed directly, that is, by pointing at them using the mouse.
-Liveness means that the user interface is always able to respond to user actions: information on the screen is continuously updated as the world that it describes changes.
-A simple example of this is that you can detach a menu item and keep it as a button.
+Transparência significa que as formas na tela são objetos que podem ser examinados ou alterados diretamente, isto é, operando sobre os mesmos usando o \foreign{mouse}.
+Imediatismo significa que a interface é sempre capaz de responder a ações do usuário: a informação na tela é continuamente atualizada à medida que o mundo que ela descreve muda.
+Um exemplo simples disso é que você pode destacar um item de um menu e mantê-lo como um botão.
-\dothis{Bring up the world menu. Blue-click once on the world menu to bring up its morphic halo, then blue-click again on the menu item you want to detach to bring up its halo. Now drag that item elsewhere on the screen by grabbing the black handle \grabHandle, as shown in \figref{detachingMenu}.}
+\dothis{Abra o \foreign{menu} \foreign{World} e clique com o botão azul sobre o mesmo para acessar o seu halo. Depois, clique sobre um item de \foreign{menu} que você deseja destacar para exibir o halo do mesmo. Agora, arraste esse item para outra posição na tela usando o ícone \grabHandle, como mostrado na \figref{detachingMenu}.}
\index{Morphic!halo}
\index{blue button}
@@ -58,43 +57,44 @@ A simple example of this is that you can detach a menu item and keep it as a but
\ifluluelse
{\centerline{\includegraphics[width=0.6\textwidth]{detachingMenu}}}
{\centerline{\includegraphics[width=0.4\textwidth]{detachingMenu}}}
- \caption{Detaching a morph, here the \menu{new morph} menu item, to make it an independent button.
+ \caption{Destacando um \foreign{morph}, aqui o \foreign{menu} \menu{new morph}, e transformando-o em um botão independente.
\label{fig:detachingMenu}}
\end{figure}
-All of the objects that you see on the screen when you run \sq are \emph{Morphs}, that is, they are instances of subclasses of class \ct{Morph}.
-\mbox{\ct{Morph}} itself is a large class with many methods; this makes it possible for subclasses to implement interesting behaviour with little code.
-You can create a morph to represent any object, although how good a representation you get depends on the object!
+Todos os objetos que você vê na tela quando roda o \sq são \emph{Morphs}, isto é, instâncias de subclasses da classe \ct{Morph}.
+\mbox{\ct{Morph}} é uma classe grande, com muitos métodos; com isso, suas subclasses podem implementar comportamento bastante interessante com relativamente pouco código. Você pode criar um \foreign{morph} para representar qualquer objeto, embora quão boa a representação vai depender do objeto em si!
-\dothis{To create a morph to represent a string object, execute the following code in a workspace, one line at a time.}
+\dothis{Para criar um \foreign{morph} que representa um objeto \ct{String}, execute o seguinte código em um \foreign{workspace}, uma linha de cada vez.}
\begin{code}{}
s := 'Morph' asMorph openInWorld.
s openViewerForArgument
\end{code}
\cmindex{Morph}{openInWorld}
-The first line creates a Morph to represent the string \ct{'Morph'}, and then opens it (that is, displays it) in the ``world'', which is the name that \sq gives to the screen.
-You should obtain a graphical element\,---\,a Morph\,---\,which you can manipulate by blue-clicking.
-The second line opens a ``viewer'' that shows you attributes of this Morph, such as its \ct{x} and \ct{y} coordinates on the screen. Clicking on one of the yellow exclamation marks sends a message to the Morph, which responds appropriately.
+A primeira linha criar um \foreign{morph} para representar o texto \ct{'Morph'}, e então o abre (isto é, exibe o mesmo) no ``mundo'', que é o nome que o \sq dá para a tela.
+Você obterá um elemento gráfico\,---\,um Morph\,---\,que você pode manipular com o botão azul.
+A segunda linha abre um visualizador que mostra atributos do seu \foreign{morph}, como suas coordenadas \ct{x} e \ct{y} na tela. Se você clicar em um dos pontos de exclamação amarelos, uma mensagem é enviada ao objeto, que responderá apropriadamente.
-Of course, it is possible to define morphs that are more interesting graphical representations than the one that you have just seen.
-The method \mthind{Object}{asMorph} has a default implementation in class \ct{Object} class that just creates a StringMorph.
-So, for example, \ct{Color tan asMorph} returns a StringMorph labeled with the result of \clsind{Color} \ct{tan printString}.
-Let's change this so that we get a coloured rectangle instead.
+Obviamente, é possível definir objetos que são graficamente mais interessantes do que o que você acabou de ver. O método \mthind{Object}{asMorph} tem uma implementação padrão na classe \ct{Object} que cria uma StringMorph. Assim por exemplo, \ct{Color tan asMorph} retorna um StringMorph cujo título é \clsind{Color} \ct{printString}. Vamos mudar isso de modo que obtenhamos um retângulo colorido.
-\dothis{Open a browser on the \ct{Color} class and add the following method to it:}
-\begin{method}{Getting a morph for an instance of \ct{Color}.}
+\dothis{Abra um navegador na classe \ct{Color} e adicione o seguinte método à mesma:}
+\begin{method}{Obtendo um \foreign{morph} para uma instância de \ct{Color}.}
Color>>>asMorph
^ Morph new color: self
\end{method}
\noindent
-Now execute \ct{Color orange asMorph} \mthind{Morph}{openInWorld} in a workspace. Instead of the string-like morph, you get an orange rectangle!
-
+Agora execute \ct{Color orange asMorph} \mthind{Morph}{openInWorld} em um \foreign{workspace}. Ao invés de um \foreign{morph} representando um texto, você verá um retângulo laranja!
%=================================================================
-\section{Manipulating morphs}
+\section{Manipulando \foreign{morphs}}
+
+\foreign{Morphs} são objetos, e podemos manipulá-los como qualquer objeto em \st: enviando mensagens, mudando suas propriedades, riando novas subclasses de Morph e assim por diante.
-Morphs are objects, so we can manipulate them like any other object in \st: by sending messages, we can change their properties, create new subclasses of Morph, and so on.
+Cada \foreign{morph}, mesmo aqueles que não abertos da tela no momento, tem uma posição e um tamanho.
+Por conveniência, todos os \foreign{morphs} ocupam uma região retangular na tela; se possuem uma forma irregular, sua posição e tamanho são as do menor retângulo capaz de rodeá-los; esse retângulo é conhecido como o retângulo limite do \foreign{morph}.
+O método \mthind{Morph}{position} retorna um ponto \ct{Point} que descreve a localização do canto superior esquerdo do \foreign{morph} (ou seja, o canto superior esquerdo de seu retângulo limite).
+A origem do sistemas de coordenadas é o canto superior esquerdo da tela, com a coordenada $y$ aumentando para baixo na tela, e a coordenada $x$ aumentando para a direita.
+O método \ct{extent} também retorna um ponto, mas esse ponto indica a largura e altura do \foreign{morph} e não a sua localização.
Every morph, even if it is not currently open on the screen, has a position and a size.
For convenience, all morphs are considered to occupy a rectangular region of the screen; if they are irregularly shaped, their position and size are those of the smallest rectangular ``box'' that surrounds them, which is known as the morph's bounding box, or just its ``bounds''.
@@ -102,7 +102,7 @@ The \mthind{Morph}{position} method returns a \ct{Point} that describes the loca
The origin of the coordinate system is the screen's upper left corner, with $y$ coordinates increasing \emph{down} the screen and $x$ coordinates increasing to the right.
The \ct{extent} method also returns a point, but this point specifies the width and height of the morph rather than a location.
-\dothis{Type the following code into a workspace and \menu{do it}:}
+\dothis{Digite o seguinte código em um \foreign{workspace} e execute-o:}
\begin{code}{}
joe := Morph new color: Color blue.
joe openInWorld.
@@ -110,21 +110,19 @@ bill := Morph new color: Color red .
bill openInWorld.
\end{code}
\noindent
-Then type \ct{joe position} and \menu{print it}.
-To move joe, execute \ct{joe position: (joe position + (10@3))} repeatedly.
+Agora digite \ct{joe position} e imprima iso. Para mover \ct{joe}, execute repetidamente \ct{joe position: (joe position + (10@3))}.
-It is possible to do a similar thing with size.
-\ct{joe} \mthind{Morph}{extent} answers joe's size; to have joe grow, execute \ct{joe extent: (joe extent * 1.1)}.
-To change the color of a morph, send it the \mthind{Morph}{color:} message with the desired \ct{Color} object as argument, for instance, \ct{joe color: Color orange}.
-To add transparency, try \ct{joe color: (Color orange alpha: 0.5)}.
+É possível fazer algo similar com o tamanho:
+\ct{joe} \mthind{Morph}{extent} responde o tamanho do objeto; para aumentá-lo, use \ct{joe extent: (joe extent * 1.1)}.
+Para mudar a cor de um \foreign{morph}, envie \mthind{Morph}{color:} com a cor desejada como um argumento. Por exemplo, \ct{joe color: Color orange}.
+Por fim, para adicionar transparência, use algo como \ct{joe color: (Color orange alpha: 0.5)}.
-\dothis{To make bill follow joe, you can repeatedly execute this code:}
+\dothis{Para fazer com que \ct{bill} acompanhe \ct{joe}, execute este código repetidamente:}
\begin{code}{}
bill position: (joe position + (100@0))
\end{code}
\noindent
-If you move joe using the mouse and then execute this code, bill will move so that it is 100 pixels to the right of joe.
-\ab{It would seem that this would be a good place to introduce the \ct{step} method}.
+Se você mover \ct{joe} usando o \foreign{mouse} e então executar o código, verá que \ct{bill} se move para uma posição 100 pixels à direta e \ct{joe}.
%=================================================================
\section{Composing morphs} |