Sha256: 6c9c0a234b396d27e204711e0a8184da3fd1ad4881b76fa20c3eec29a0fd14fc

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

Shoes.app height: 150 do
  @stack = stack height: 150, scroll: true do
    para strong("Press arrow keys to scroll too!\n")
    20.times do |i|
      para i.to_s
    end

    oval 50, 50, 50, 50, fill: orange
    rect 50, 150, 50, 50, fill: purple
    arrow 80, 250, 60, fill: green
  end

  keypress do |key|
    if key == :up
      @stack.scroll_top -= 10
    else
      @stack.scroll_top += 10
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.rc1 samples/simple_scroll.rb