librelist archives

« back to archive

elements appended to flow don't flow

elements appended to flow don't flow

From:
Sebastjan Hribar
Date:
2014-02-05 @ 11:20
Hi,

I've made another game/learning application [1] for my daughters and I 
have one pending question at this stage. I'm appending letters to a 
flow, but they don't flow. They stack [2]. Does the append stack 
elements by default?

I know I could have displayed the input in one go, but I'd like to see 
the letters append as they are pressed.

I've uploaded the screen-shot of the problem [3]. As the letters, 
corresponding to the word represented by the image, are pressed, they're 
appended to the flow below. The second word in the screen-shot is the 
solution and is displayed when the submit button is pressed.

Thank you in advance if someone will have the time to look at this.


[1] https://github.com/sebastjan-hribar/abc123
[2] https://github.com/sebastjan-hribar/abc123/blob/master/lib/abc123.rb 
=> the block from lines 174 to 183 appends to the flow in line 217.
[3] https://github.com/sebastjan-hribar/abc123/blob/master/abc123_words.png

regards,
seba

Re: [shoes] elements appended to flow don't flow

From:
Tobias Pfeiffer
Date:
2014-02-05 @ 11:52
Hi Seba,

I created this minimal sample:

Shoes.app do
  f = flow do end
  3.times do f.append do para 'normal' end end
  button 'hit' do f.append do subtitle 'a', margin_top: 20, height: 50, 
width: 150 end end
end

For me the first a goes to the next line and then a couple of as in the 
same line and then next line again. It worked fine for me without the 
explicit width/height set in there. (on both shoes3 and shoes4, the 
explicit width/height even crashes shoes4)

However - what you are seeing is a bug - e.g. the expected behavior for 
append on a flow is definitely to flow along (as long as there is 
enough space on the current line).
For shoes3 it's just unlikely that this bug will see a fix.. :(

Happy to see you programming games for your daughters, that game looks 
like fun! =)

Cheers,
Tobi

On Wed 05 Feb 2014 12:20:56 PM CET, Sebastjan Hribar wrote:
> Hi,
>
> I've made another game/learning application [1] for my daughters and I
> have one pending question at this stage. I'm appending letters to a
> flow, but they don't flow. They stack [2]. Does the append stack
> elements by default?
>
> I know I could have displayed the input in one go, but I'd like to see
> the letters append as they are pressed.
>
> I've uploaded the screen-shot of the problem [3]. As the letters,
> corresponding to the word represented by the image, are pressed, they're
> appended to the flow below. The second word in the screen-shot is the
> solution and is displayed when the submit button is pressed.
>
> Thank you in advance if someone will have the time to look at this.
>
>
> [1] https://github.com/sebastjan-hribar/abc123
> [2] https://github.com/sebastjan-hribar/abc123/blob/master/lib/abc123.rb
> => the block from lines 174 to 183 appends to the flow in line 217.
> [3] https://github.com/sebastjan-hribar/abc123/blob/master/abc123_words.png
>
> regards,
> seba

Re: [shoes] elements appended to flow don't flow

From:
Sebastjan Hribar
Date:
2014-02-05 @ 12:57
Hi Tobi,

thank you for quick response.

It's unfortunate that this is a bug, however I'm still glad that it's 
not in the "I'm doing it wrong" category:)

Your example works fine with green_shoes.
So I've added the explicit height and width for the letter. The result 
is seen in the new demo image [1].

> For shoes3 it's just unlikely that this bug will see a fix.. :(

I'd be happy to tackle this bug, but to be honest, I wouldn't know 
exactly where to start. The time and effort I'd have to invest to learn 
new things are not a problem though:)


[1] https://github.com/sebastjan-hribar/abc123/blob/master/abc123_words.png

Thank you!

regards and I hope to be able to join the upcoming hangout
seba