3

Can I center the contents of a flow in Shoes?

I know that a paragraph can be centred like:

para 'Centred paragrpah', :align=>'center'

However, this does not work with flows:

flow(:align=>'center') do
    …
end

No errors are brought up, but the contents remain left justified.

Jeffrey Aylesworth
  • 8,242
  • 9
  • 40
  • 57

1 Answers1

3

Not completely sure. What is it in your flow you are trying to centre? You can try a margin left trick as per HTML and CSS.

This gives a flow with left, centre and right justified text that remains centred in the window as it is resized:

Shoes.app do
flow   do
    style(:margin_left => '50%', :left => '-25%')
        border blue
        para "Some left justified text\n", :align => 'left'
        para "Some centred text\n", :align => 'center'
        para "some right justified text\n", :align => 'right'
end
end
atomicules
  • 2,155
  • 25
  • 24
  • Didn't work, the flow was left aligned in the middle of the window. Interesting trick though – Jeffrey Aylesworth Nov 19 '09 at 00:01
  • Btw, I am trying to centre two stacks of flows of buttons – Jeffrey Aylesworth Nov 19 '09 at 00:03
  • As per my comment on your other question, I wonder if this is a platform/shoes-revision issue. The above works for me on Windows XP with Shoes Raisins and Policeman builds. Which platform are you using? what version of Shoes. I also tried the above with a Shoes app containing two stack, each stack contained a flow of three buttons. Applying the margin style to the stacks worked. – atomicules Nov 19 '09 at 09:27
  • Ok, I checked on OSX PPC (I don't have an Intel mac) with Shoes 2 and a recent build of Shoes and I get the same result I get on Windows. I might ask someone on the Shoes mailing list to look into this as I would have thought the results would be the same on PPC and Intel. – atomicules Nov 24 '09 at 22:05
  • Okay, since it seems to be entirely my problem, I'll accept the answer. I'll check on the shoes mailing list – Jeffrey Aylesworth Nov 29 '09 at 00:54