Centring a flow in Shoes
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开发者_如何学Python(:align=>'center') do
…
end
No errors are brought up, but the contents remain left justified.
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
精彩评论