Sha256: 37691c9423d4be6bc3e93f56897b19e9dbf6098310ed1aed5dbb3e419678665b

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

class TestScreen < ProMotion::Screen
  title "Test Screen"
  
  def on_load
    @label = add_element UILabel.alloc.initWithFrame(CGRectMake(5, 5, 320, 30)), {
      text: "This is awesome!",
      font: UIFont.systemFontOfSize(18)
    }
    @button = add_element UIButton.alloc.initWithFrame([[5,45], [300, 40]]), {
      title: "Button",
      "addTarget:action:forControlEvents:" => [self, :hello, UIControlEventTouchUpInside],
      backgroundColor: UIColor.whiteColor
    }
    @button.addSubview(@label)

    set_nav_bar_right_button "Close", action: :close_this if self.parent_screen
  end

  def close_this
    close
  end

  def hello
    puts "hello"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ProMotion-0.4.1 app/screens/test_screen.rb
ProMotion-0.4.0 app/screens/test_screen.rb