如何在单击时将边框应用到流程?

发布于 2024-07-27 00:21:52 字数 434 浏览 3 评论 0原文

我有这个 Shoes 应用程序:

flow :top => 10, :left => 10 do
  flow :width => 0.3 do 
    para @board.deck.card
    click do
      if @board.source_pile
        @board.source_pile = nil
        @deck_border.hide
      else
        @board.source_pile = @board.deck
        @deck_border = border yellow, :strokewidth => 2
      end
    end
  end
end

我想仅将边框应用于第二个流程,但由于某种原因边框出现在整个应用程序周围。 我缺少什么?

I've got this piece of Shoes app:

flow :top => 10, :left => 10 do
  flow :width => 0.3 do 
    para @board.deck.card
    click do
      if @board.source_pile
        @board.source_pile = nil
        @deck_border.hide
      else
        @board.source_pile = @board.deck
        @deck_border = border yellow, :strokewidth => 2
      end
    end
  end
end

I would like to apply border only to the second flow, but for some reason the border appears around the whole application. What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天涯离梦残月幽梦 2024-08-03 00:21:52

鞋子有棘手的块。 简而言之,在块中,self 通常指的是应用程序。 为了解决这个问题,我们必须创建一个变量来保存我们想要边界的流:

flow :top => 10, :left => 10 do
  inner = flow :width => 0.3 do 
    para @board.deck.card
    click do
      if @board.source_pile
        @board.source_pile = nil
        @deck_border.hide
      else
        @board.source_pile = @board.deck
        @deck_border = inner.border yellow, :strokewidth => 2
      end
    end
  end
end

Shoes has tricky blocks. In a nutshell, in blocks, self typically refers to the application. To counter this, we'll have to create a variable to hold the flow we want to border:

flow :top => 10, :left => 10 do
  inner = flow :width => 0.3 do 
    para @board.deck.card
    click do
      if @board.source_pile
        @board.source_pile = nil
        @deck_border.hide
      else
        @board.source_pile = @board.deck
        @deck_border = inner.border yellow, :strokewidth => 2
      end
    end
  end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文