Sha256: 5d4c62aa5a447ac565df8aac0cbc866390c9afb044640449c90467d924dfd66e

Contents?: true

Size: 637 Bytes

Versions: 14

Compression:

Stored size: 637 Bytes

Contents

# @provides MotionKit::Layout
# @provides MotionKit::NSViewHelpers
# @requires MotionKit::TreeLayout
module MotionKit
  class Layout < TreeLayout

    # platform specific default root view
    def default_root
      # child Layout classes will return *their* NSView subclass from self.targets
      view_class = self.class.targets || MotionKit.default_view_class
      view_class.alloc.initWithFrame([[0, 0], [0, 0]])
    end

    def add_child(subview)
      target.addSubview(subview)
    end

    def remove_child(subview)
      subview.removeFromSuperview
    end

  end

  class NSViewHelpers < Layout
    targets NSView
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
motion-kit-1.1.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-1.0.3 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-1.0.2 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-1.0.1 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-1.0.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.18.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.17.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.16.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.15.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.14.2 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.14.1 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.14.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.13.0 lib/motion-kit-osx/helpers/nsview_helpers.rb
motion-kit-0.12.0 lib/motion-kit-osx/layouts/nsview_helpers.rb