<br><br><div class="gmail_quote">On Tue, Nov 25, 2008 at 5:25 AM, Filip Malczak <span dir="ltr">&lt;<a href="mailto:filet00@gmail.com">filet00@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/11/23 Filip Malczak <span dir="ltr">&lt;<a href="mailto:filet00@gmail.com" target="_blank">filet00@gmail.com</a>&gt;</span><div><div></div><div class="Wj3C7c"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi, Im Filip, and Im new at squeak. Ive read &#39;Squeak by example&#39;, and now I try to make my first program. Ive already written in Pascal and a bit (really small bit) of C. Im from Poland, so my english can by not realy good.<br>


<br>Now time for my problem:<br>I wanna write a program to write notes on stave (for music). Later Im gonna add translating notes into tabulatures for guitar, and later - for flute. But I begin with just notes.<br>I started from creating object &#39;Pieciolinia&#39; which is stave (in polish). Then I found out I need some tool to change metrum (Im not sure if its the same in english and polish, its speed of song, written on begining of stave, just after treble clef). So I made class &#39;TempoButton&#39; which is expected to contain 3 smaller buttons: gora, dol &amp; strzalka. gora is top number of metrum, dol - bottom number and strzalka is button to show a list of usual metrums (you click it and you have a list). gora and dol should open FillInTheBlank and change itself captions to what is written by user, and strzalka should open a PopUpMenu with list of some metrums.<br>


Then I created class &#39;SkladowyButton&#39; which is my version of Basic Button (I wasnt able to find out how to handle with it, so I tried to create new one. And I could make up my own outlook for button).<br>Ive written some methods, but when I try to execute (do it with ctrl+d):<br>


<br clear="all">but:=TempoButton new.<br>but drawOn: World.<br><br>I have debugger as on zrzut1.jpg (I send it).<br></blockquote></div></div></div></blockquote></div><br>Hi Filip.<br><br>You&#39;re calling &gt;&gt;bounds: on a Rectangle, which it doesn&#39;t understand.<br>
<br>Open up a Browser and find the &quot;Rectangle&quot; class. This will show all the method selectors that Rectangle understands.<br><br>If you bring up a halo for any morph on the screen (middle-click, right-click alt-click or whatever depending on platform), select &quot;Debug&quot; and then &quot;inspect morph&quot;, then type in &quot;self bounds&quot; in the text space at the bottom of the inspector window and press &quot;alt-i&quot;, you&#39;ll see that calling &gt;&gt;bounds on any Morph instance returns a Rectangle.<br>
<br>So, in your code, you can simply do:<br><br>rec := aMorph bounds.<br><br>Or even more simply, remove the &quot;rec&quot; instance variable and do:<br><br>aCanvas fillRectangle: (self bounds) color: (self color).<br><br>
I like using parenthesis to make the arguments stand out more. You don&#39;t need them if you don&#39;t want them.<br><br>Note also that Rectangle is an immutable class. Its methods return copies of itself.<br><br>Gulik.<br>
<br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a><br>