Shoes2 newbie question about documentation example

Hi,

I following the documentation at http://hackety.org/press/nks.pdf

It suggests the following code:
Shoes.app do
title “Title”
subtitle “Subtitle”
# [snip]
end

will produce the output:
Title 34px
Subtitle 26px
[snip]

First, to list the entries as show, the source list needs to be
embedded in the block:
stack do
end

Secondly, the demo leads a newbie to think the pixel heights will be
explicitly printed. Of course, no sizes are printed.

My question: is it easy to amend the source code to actually to be
included in the output as suggested? (I just want to see if Shoe2 is
really as easy as its advertisers suggest.

Thanks in Advance,
Richard

My question: is it easy to amend the source code to actually to be
included in the output as suggested? (I just want to see if Shoe2 is
really as easy as its advertisers suggest.

you mean to print it out to the console?
=r

On Jul 11, 9:04 pm, Roger P. [email protected] wrote:

My question: is it easy to amend the source code to actually to be
included in the output as suggested? (I just want to see if Shoe2 is
really as easy as its advertisers suggest.

you mean to print it out to the console?
=r

Posted viahttp://www.ruby-forum.com/.

Currently, the output is a bunch of lines:
Title
Subtitle
[snip]

The “Title” text appears to be 40 px tall as claimed in the tutorial
Likewise, the “Subtitle” text appears to be 26 px.

I want each line to include a computation of its height and
print that computational result appended to the the text.

So the output will be:
Title 40px
Subtitle 26px

just as presented in the tutorial. However, the heights are to be
computed, not include as the literal text input.

Is that clear?

Best wishes,
Richard

So the output will be:
Title 40px
Subtitle 26px

It might be possible. Maybe :slight_smile:
Maybe ask in the shoes mailing list?
=r

On Jul 13, 12:45 pm, Roger P. [email protected] wrote:

So the output will be:
Title 40px
Subtitle 26px

It might be possible. Maybe :slight_smile:
Maybe ask in the shoes mailing list?
=r

Posted viahttp://www.ruby-forum.com/.

Hi Roger,

Maybe ask in the shoes mailing list?
I wanted to do that, but I could never find a URL for it. Your
suggestion spurred me to redouble my efforts to find it.

I happy to report SUCCESS: http://news.gmane.org/gmane.comp.lib.shoes

Many thanks for your response.

Best wishes,
Richard

RichardOnRails wrote:

Hi,

I following the documentation at http://hackety.org/press/nks.pdf

You got a page number? Sheesh!

It suggests the following code:
Shoes.app do
title “Title”
subtitle “Subtitle”
# [snip]
end

will produce the output:
Title 34px
Subtitle 26px
[snip]

On page 23, there is a picture with similar output. To me the
descriptions and pictures suggested this:

  1. a para has a certain sized font
  2. to display other sized fonts you can use other ‘tags’, e.g. banner,
    title, subtitle, etc.
  3. the size of the font is shown next to the displayed strings in the
    picture to give you an idea of the size of the font corresponding to
    each tag.

First, to list the entries as show, the source list needs to be
embedded in the block:
stack do
end

Ok. Not really a big deal.

My question: is it easy to amend the source code to actually to be
included in the output as suggested? (I just want to see if Shoe2 is
really as easy as its advertisers suggest.

There’s nothing in the Nobody Knows Shoes manual that shows you how to
get the default size of a tag. It shows you how to set the size, for
example:

title “Hello World”, :size => 10

so there is a size property somewhere. But this doesn’t work:

title title.size

I would guess that the title tag creates a title instance, and the size
is set on the title instance, and then the title instance is added to
the main app.

On Jul 13, 12:45 pm, Roger P. [email protected] wrote:

So the output will be:
Title 40px
Subtitle 26px

It might be possible. Maybe :slight_smile:
Maybe ask in the shoes mailing list?
=r

Posted viahttp://www.ruby-forum.com/.

Hi Roger, I’ve started looking into the Shoes list on GitHub. I just
realized today that I hadn’t posted my acknowledgment of that advise.

So, belatedly: Thanks!

Best wishes,
Richard

7stud – wrote:

There’s nothing in the Nobody Knows Shoes manual that shows you how to
get the default size of a tag. It shows you how to set the size, for
example:

title “Hello World”, :size => 10

so there is a size property somewhere. But this doesn’t work:

title title.size

I would guess that the title tag creates a title instance, and the size
is set on the title instance, and then the title instance is added to
the main app.

…but this doesn’t work either:

@t = title “Hello World”
subtitle @t.size

On Jul 19, 6:42 pm, 7stud – removed_email_addr[email protected] wrote:

Posted viahttp://www.ruby-forum.com/.
Hi 7Stud,

Thanks for your advice. I’ve been moving slowly on this. Your post
will give me greater motivation. I’ll post back in a few days if I
have any luck.

Best wishes,
Richard

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs