librelist archives

« back to archive

subscribe

subscribe

From:
comptroller killjoy
Date:
2009-11-05 @ 17:40
subscribe

subscribe

From:
Yvon Thoraval
Date:
2014-07-12 @ 16:04
subscribe

subscribe

From:
Mike Woodhouse
Date:
2011-11-10 @ 17:57
Mike

Re: [shoes] subscribe

From:
ashbb
Date:
2011-11-10 @ 20:37
Hi Mike,

Welcome to the Shoes ML! :)

Let's have fun,
ashbb

subscribe

From:
Yvon Thoraval
Date:
2012-10-10 @ 21:08
subscribe

-- 
Yvon

Re: [shoes] subscribe

From:
ashbb
Date:
2012-10-10 @ 21:39
Hi Yvon,

Welcome to Shoes!

We've been developing Shoes 4 on github for now.
So, many discussions are on the shoes/shoes4 issue board:
https://github.com/shoes/shoes4/issues

Let's have fun with Shoes! :)

ashbb

subscribe

From:
Roald Dino
Date:
2013-05-27 @ 18:24
subscribe

Re: [shoes] subscribe

From:
Sebastjan Hribar
Date:
2013-05-27 @ 18:28
Dne 27. 05. 2013 20:24, piše Roald Dino:
> subscribe
Welcome:)

regards
seba

Re: [shoes] subscribe

From:
RoaldD
Date:
2013-05-27 @ 18:41
On 05/27/2013 02:28 PM, Sebastjan Hribar wrote:
> Dne 27. 05. 2013 20:24, piše Roald Dino:
>> subscribe
> Welcome:)
>
> regards
> seba
Hey Sebastjan! Let me start by saying, I love Shoes!
I am a beginning programmer and ran into a little snag. I was studying 
the following source code in order to extend it:


str, t = "", nil

Shoes.app :height => 500, :width => 450 do

     background rgb(77, 77, 77)

     stack :margin => 10 do

         para span("Text Editor", :stroke => red, :fill => white)

     end


     stack :margin => 10 do

         t = para "", :font => "Monospace 12px", :stroke => white

         t.cursor =-1

     end


     keypress do |k|

         case k

         when String

             str += k

         when :backspace

             str.slice!(-1)

         when :tab

             str += " "

         when :alt_q

             quit

         when :alt_c

             self.clipboard = str

         when :alt_v

             str += self.clipboard

         when :left    ## I want to control the cursor

             ## what do I add here? I want the cursor to go to the left
             ## I tried*t.cursor = -2*  and*t.cursor = (str.length -2)*  


         end

         t.replace str

     end

end    

Can you guys help me with this? And also: Is this an appropriate place 
for these sort of questions?

Re: [shoes] subscribe

From:
Sebastjan Hribar
Date:
2013-05-27 @ 19:11
Hey Sebastjan! Let me start by saying, I love Shoes!
> I am a beginning programmer and ran into a little snag. I was studying 
> the following source code in order to extend it:

well, I am not an expert either, but I love ruby and shoes:)
I mostly use green shoes and I've ran your code and got an error 
regarding the span. So I replaced

para span("Text Editor", :stroke => red, :fill => white)


with

para "Text Editor", :align => "center", :stroke => red, :fill => white

I don't know if that's what you're going for but it works on green shoes.

I haven't had the time yet to play around with the cursor control, but 
I'll give it a go later...

>
> str, t = "", nil
>
> Shoes.app :height => 500, :width => 450 do
>      background rgb(77, 77, 77)
>      stack :margin => 10 do
>          para span("Text Editor", :stroke => red, :fill => white)
>      end
>
>      stack :margin => 10 do
>          t = para "", :font => "Monospace 12px", :stroke => white
>          t.cursor =-1
>      end
>
>      keypress do |k|
>          case k
>          when String
>              str += k
>          when :backspace
>              str.slice!(-1)
>          when :tab
>              str += " "
>          when :alt_q
>              quit
>          when :alt_c
>              self.clipboard = str
>          when :alt_v
>              str += self.clipboard
>          when :left    ## I want to control the cursor
>              ## what do I add here? I want the cursor to go to the left
>              ## I tried*t.cursor = -2*  and*t.cursor = (str.length -2)*  
>
>          end
>          t.replace str
>      end
> end    
>
> Can you guys help me with this? And also: Is this an appropriate place 
> for these sort of questions?
There are some true ruby and shoes masters here on the list that have 
helped me learn, so yes, this is the place to ask:)

kind regards
seba
love shoes!

Re: [shoes] subscribe

From:
RoaldD
Date:
2013-05-27 @ 19:47
Thanks for the quick reply. I was looking around Green Shoes, and it 
looks awesome. The documentation is deeper than Shoes3 (Red Shoes I guess).

RoaldD

Re: [shoes] subscribe

From:
J. Kaiden
Date:
2013-05-27 @ 20:53
hi RoalD,

  welcome to the mailing list!  this is definitely the place to ask,
answer, and comment on all things shoes...

  until shoes4 is released, things are a little bit 'funny,' but shoes3
runs pretty well as it is, and green shoes is also great.  the nice thing
about green is that it installs as a gem.  there are certain differences
between the two, but there are also lots of people on this list who can
help you out with them.

  one way that you can see all the methods for any object in shoes (or
ruby) is by using the #methods method.

  doing something like:

t = para "hi"
t.methods.sort.each{|method| puts method}

  ...will give you a nice list of all the methods that work with 'para'.
 unfortunately you don't get any description of how to use them, but at
least you get the list, and that's a great place to start!  the shoes3
manual (not online, but with the install) also works well for explaining
lots of stuff, and has a working search box.

as far as moving the cursor around - check this out:

 Shoes.app  do

t = para "here's a whole bunch of text"
t.cursor = 5

                keypress do |k|
case k
when :right
t.cursor += 1; p t.cursor
when :left
t.cursor -= 1; p t.cursor
end
end
end

  ...  also notice that in your original code, 't' is inside a stack, which
means you'll have to make it an instance variable '@t' if you want to use
access it outside of that stack.

   anyway - welcome again, and

  get your shoes on!

  - j


On Mon, May 27, 2013 at 9:47 PM, RoaldD <roalddino@gmail.com> wrote:

> Thanks for the quick reply. I was looking around Green Shoes, and it
> looks awesome. The documentation is deeper than Shoes3 (Red Shoes I guess).
>
> RoaldD
>

Re: [shoes] subscribe

From:
RoaldD
Date:
2013-05-27 @ 22:41
Hey J,
Thanks for your quick answer and thanks for putting "p" on the code so I 
could understand what was going on.

  ...  also notice that in your original code, 't' is inside a stack, 
which means you'll
have to make it an instance variable '@t' if you want to use access it 
outside of that stack.

Yeah, but I declared the variable on the top of the code with

str, t = "", nil

so shouldn't it be accessible? (BTW it's not my code, it's in the 
shoebox: "Shoes/samples/simple-editor.rb")
Thank you for your time.

Also, good job Tobias!

  I wish I was good enough to contribute to Shoes.
What learning resources did you guys personally use? Lots of coding and 
asking questions?

Re: [shoes] subscribe

From:
Sebastjan Hribar
Date:
2013-05-28 @ 10:29
>
> What learning resources did you guys personally use? Lots of coding and
> asking questions?
>
>
Personaly I use the pickaxe book and the Rdocs as a reference and I went
through the courses on codeacdemy and codeschool, but that was only the
beginning for me as I had almost no clue whatsoever about programming
before.

Then I just started programming actual stuff I wanted to make and I still
do and learn as I go along. However, without the community here on ML and
the one on the Ruby forum it would have been so much harder.

In relation to this, I have a question for everyone about testing. My
approach to programming was a bit disorganized to say the least because had
no clue. Hence I haven't really taken up the testing aspect. This is on my
learning list as the next item. I need some advise on this:
- should I start with unit testing and go from there (all I know is what is
in the pickaxe) or can I just pickup a framework like RSpec? I've been
reading about BDD and it seems like it would fit me. If someone could just
point me in the right direction I'd be very grateful.

regards
seba

Re: [shoes] subscribe

From:
Davor Babic
Date:
2013-05-28 @ 16:58
Have a look at "Test Driven Development: By Example" by Kent Beck. (Or 
anything else by Kent Beck, really. The dude is amazing.)

I think that book might be a good introduction that will help get you 
started. Once you understand the philosophy behind TDD, the actual 
framework that you use becomes less important.

And yeah, minitest is what you should be looking at.
--
Davor Babic
davor@davor.se


Sebastjan Hribar wrote:
>
>
>     What learning resources did you guys personally use? Lots of coding and
>     asking questions?
>
> Personaly I use the pickaxe book and the Rdocs as a reference and I went
> through the courses on codeacdemy and codeschool, but that was only the
> beginning for me as I had almost no clue whatsoever about programming
> before.
>
> Then I just started programming actual stuff I wanted to make and I
> still do and learn as I go along. However, without the community here on
> ML and the one on the Ruby forum it would have been so much harder.
>
> In relation to this, I have a question for everyone about testing. My
> approach to programming was a bit disorganized to say the least because
> had no clue. Hence I haven't really taken up the testing aspect. This is
> on my learning list as the next item. I need some advise on this:
> - should I start with unit testing and go from there (all I know is what
> is in the pickaxe) or can I just pickup a framework like RSpec? I've
> been reading about BDD and it seems like it would fit me. If someone
> could just point me in the right direction I'd be very grateful.
>
> regards
> seba
>
>

Re: [shoes] subscribe

From:
Sebastjan Hribar
Date:
2013-05-28 @ 17:30
Dne 28. 05. 2013 18:58, piše Davor Babic:
> Have a look at "Test Driven Development: By Example" by Kent Beck. (Or
> anything else by Kent Beck, really. The dude is amazing.)
>
> I think that book might be a good introduction that will help get you
> started. Once you understand the philosophy behind TDD, the actual
> framework that you use becomes less important.
>
> And yeah, minitest is what you should be looking at.
> --
> Davor Babic
> davor@davor.se
>
thank you both. I'll have a look at both TDD and BDD to understand the 
principles.
It's just so overwhelming because there's so much I'd like to learn and 
so little time. I wish I'd started like 10 years ago:(

regards,
seba

Re: [shoes] subscribe

From:
Arne Brasseur
Date:
2013-05-28 @ 14:21
I would recommend looking at minitest. It comes with Ruby 1.9 (although for
the latest features you can also install the gem), and it supports both the
TDD and the BDD style.

Just pick the style that feels most natural to you, and start testing.
There is a ton of advice out there about how to do testing well, but don't
look at that too much and just try it out.

On 28 May 2013 12:29, Sebastjan Hribar <sebastjan.hribar@gmail.com> wrote:

>
>
>> What learning resources did you guys personally use? Lots of coding and
>> asking questions?
>>
>>
> Personaly I use the pickaxe book and the Rdocs as a reference and I went
> through the courses on codeacdemy and codeschool, but that was only the
> beginning for me as I had almost no clue whatsoever about programming
> before.
>
> Then I just started programming actual stuff I wanted to make and I still
> do and learn as I go along. However, without the community here on ML and
> the one on the Ruby forum it would have been so much harder.
>
> In relation to this, I have a question for everyone about testing. My
> approach to programming was a bit disorganized to say the least because had
> no clue. Hence I haven't really taken up the testing aspect. This is on my
> learning list as the next item. I need some advise on this:
> - should I start with unit testing and go from there (all I know is what
> is in the pickaxe) or can I just pickup a framework like RSpec? I've been
> reading about BDD and it seems like it would fit me. If someone could just
> point me in the right direction I'd be very grateful.
>
> regards
> seba
>
>
>

Re: [shoes] subscribe

From:
RoaldD
Date:
2013-05-28 @ 18:15
On 05/28/2013 06:29 AM, Sebastjan Hribar wrote:
>
>
> Personaly I use the pickaxe book and the Rdocs as a reference and I 
> went through the courses on codeacdemy and codeschool, but that was 
> only the beginning for me as I had almost no clue whatsoever about 
> programming before.
>
Thanks.