Hi there! (and my first problem)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hi there! (and my first problem)

Filip Malczak
Hi, Im Filip, and Im new at squeak. Ive read 'Squeak by example', 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.

Now time for my problem:
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.
I started from creating object 'Pieciolinia' 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 'TempoButton' which is expected to contain 3 smaller buttons: gora, dol & 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.
Then I created class 'SkladowyButton' 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).
Ive written some methods, but when I try to execute (do it with ctrl+d):

but:=TempoButton new.
but drawOn: World.

I have debugger as on zrzut1.jpg (I send it).

I send whole category (I fileOut'ed it with yellow button on Browser) 'Nuty' (it means 'Notes' in PL).

I would be really pleased if anyone would try to help me. I dont expect you to give the whole code, but to show where is problem and what I should change. I just wanna learn (on school I do Pascal, and I know that on studies (next year) Im gonna start with Java and objects, so I try to learn).

Oh, and last thing: I use Squeak added to Ubuntu 8.10 (ver 3.9). Of course I work on this Linux. I know that it propably wont mean anything important, cause I work on VM, but better to write too much than too little ;)

--
Greeting:
Filip
GG: 2486889
mail: [hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Hi there! (and my first problem)

Michael van der Gulik-2


On Mon, Nov 24, 2008 at 2:10 AM, Filip Malczak <[hidden email]> wrote:
Hi, Im Filip, and Im new at squeak. Ive read 'Squeak by example', 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.

Now time for my problem:
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.
I started from creating object 'Pieciolinia' 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 'TempoButton' which is expected to contain 3 smaller buttons: gora, dol & 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.
Then I created class 'SkladowyButton' 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).
Ive written some methods, but when I try to execute (do it with ctrl+d):

but:=TempoButton new.
but drawOn: World.

I have debugger as on zrzut1.jpg (I send it).

I send whole category (I fileOut'ed it with yellow button on Browser) 'Nuty' (it means 'Notes' in PL).

I would be really pleased if anyone would try to help me. I dont expect you to give the whole code, but to show where is problem and what I should change. I just wanna learn (on school I do Pascal, and I know that on studies (next year) Im gonna start with Java and objects, so I try to learn).

Oh, and last thing: I use Squeak added to Ubuntu 8.10 (ver 3.9). Of course I work on this Linux. I know that it propably wont mean anything important, cause I work on VM, but better to write too much than too little ;)

Hi Filip.

I don't see the screenshot attached to your email. Did you forget it, or is GMail being lame for me?

Cheers,
Michael.



--
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Hi there! (and my first problem)

Filip Malczak
I forgot it, but I sent it at once with another mail, but it was too big (over 100kb) so it waits for mod allowance. Ill try to get it on some rapidshare or something later, but now I go to school.

Hi Filip.

I don't see the screenshot attached to your email. Did you forget it, or is GMail being lame for me?

Cheers,
Michael.

--
Pozdrawiam:
Filip
GG: 2486889
mail: [hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Hi there! (and my first problem)

Filip Malczak
In reply to this post by Filip Malczak
2008/11/23 Filip Malczak <[hidden email]>
Hi, Im Filip, and Im new at squeak. Ive read 'Squeak by example', 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.

Now time for my problem:
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.
I started from creating object 'Pieciolinia' 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 'TempoButton' which is expected to contain 3 smaller buttons: gora, dol & 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.
Then I created class 'SkladowyButton' 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).
Ive written some methods, but when I try to execute (do it with ctrl+d):

but:=TempoButton new.
but drawOn: World.

I have debugger as on zrzut1.jpg (I send it).

I send whole category (I fileOut'ed it with yellow button on Browser) 'Nuty' (it means 'Notes' in PL).

I would be really pleased if anyone would try to help me. I dont expect you to give the whole code, but to show where is problem and what I should change. I just wanna learn (on school I do Pascal, and I know that on studies (next year) Im gonna start with Java and objects, so I try to learn).

Oh, and last thing: I use Squeak added to Ubuntu 8.10 (ver 3.9). Of course I work on this Linux. I know that it propably wont mean anything important, cause I work on VM, but better to write too much than too little ;)
[hidden email]


Here is my problem again. This time I finally send files:
http://rapidshare.com/files/166964552/squeak1Filip.zip.html
--
Pozdrawiam:
Filip
GG: 2486889
mail: [hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: Hi there! (and my first problem)

Michael van der Gulik-2


On Tue, Nov 25, 2008 at 5:25 AM, Filip Malczak <[hidden email]> wrote:
2008/11/23 Filip Malczak <[hidden email]>

Hi, Im Filip, and Im new at squeak. Ive read 'Squeak by example', 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.

Now time for my problem:
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.
I started from creating object 'Pieciolinia' 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 'TempoButton' which is expected to contain 3 smaller buttons: gora, dol & 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.
Then I created class 'SkladowyButton' 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).
Ive written some methods, but when I try to execute (do it with ctrl+d):

but:=TempoButton new.
but drawOn: World.

I have debugger as on zrzut1.jpg (I send it).

Hi Filip.

You're calling >>bounds: on a Rectangle, which it doesn't understand.

Open up a Browser and find the "Rectangle" class. This will show all the method selectors that Rectangle understands.

If you bring up a halo for any morph on the screen (middle-click, right-click alt-click or whatever depending on platform), select "Debug" and then "inspect morph", then type in "self bounds" in the text space at the bottom of the inspector window and press "alt-i", you'll see that calling >>bounds on any Morph instance returns a Rectangle.

So, in your code, you can simply do:

rec := aMorph bounds.

Or even more simply, remove the "rec" instance variable and do:

aCanvas fillRectangle: (self bounds) color: (self color).

I like using parenthesis to make the arguments stand out more. You don't need them if you don't want them.

Note also that Rectangle is an immutable class. Its methods return copies of itself.

Gulik.

--
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: Hi there! (and my first problem)

Filip Malczak
Thanks ;) In deed - I found it out yesterday evening, but couldnt try (I just thought of the whole structure ;) ). Once again: thanks.

2008/11/24 Michael van der Gulik <[hidden email]>


On Tue, Nov 25, 2008 at 5:25 AM, Filip Malczak <[hidden email]> wrote:
2008/11/23 Filip Malczak <[hidden email]>

Hi, Im Filip, and Im new at squeak. Ive read 'Squeak by example', 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.

Now time for my problem:
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.
I started from creating object 'Pieciolinia' 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 'TempoButton' which is expected to contain 3 smaller buttons: gora, dol & 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.
Then I created class 'SkladowyButton' 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).
Ive written some methods, but when I try to execute (do it with ctrl+d):

but:=TempoButton new.
but drawOn: World.

I have debugger as on zrzut1.jpg (I send it).

Hi Filip.

You're calling >>bounds: on a Rectangle, which it doesn't understand.

Open up a Browser and find the "Rectangle" class. This will show all the method selectors that Rectangle understands.

If you bring up a halo for any morph on the screen (middle-click, right-click alt-click or whatever depending on platform), select "Debug" and then "inspect morph", then type in "self bounds" in the text space at the bottom of the inspector window and press "alt-i", you'll see that calling >>bounds on any Morph instance returns a Rectangle.

So, in your code, you can simply do:

rec := aMorph bounds.

Or even more simply, remove the "rec" instance variable and do:

aCanvas fillRectangle: (self bounds) color: (self color).

I like using parenthesis to make the arguments stand out more. You don't need them if you don't want them.

Note also that Rectangle is an immutable class. Its methods return copies of itself.

Gulik.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners




--
Pozdrawiam:
Filip
GG: 2486889
mail: [hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners