tags:

views:

59

answers:

1

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.

A: 

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
i5m
Didn't work, the flow was left aligned in the middle of the window. Interesting trick though
Jeffrey Aylesworth
Btw, I am trying to centre two stacks of flows of buttons
Jeffrey Aylesworth
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.
i5m
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.
i5m
Okay, since it seems to be entirely my problem, I'll accept the answer. I'll check on the shoes mailing list
Jeffrey Aylesworth