如何在Ruby GUI Toolkit中对齐按钮

问题描述 投票:0回答:1

我正在使用Ruby中的Shoes工具包创建一个GUI应用程序,并使用require 'green_shoes' gem。

项目正在进行中,但我有一个问题,将按钮对齐到中心是否有人知道如何?我有一个示例代码:

Shoes.app width:500, height: 400 do
     stack do
          para "input here"
          button button1
          @content = edit_line
     end
end
css ruby shoes green-shoes
1个回答
0
投票

您可以使用:left,right,top和bottom。我不确定居中,但你可以给出x,y坐标,以像素为单位。

stack(left: 35, top: 90) do
      para "input here"
      button button1
      @content = edit_line
 end

这也是一个很好的演练:http://shoesrb.com/walkthrough/

© www.soinside.com 2019 - 2024. All rights reserved.