Sha256: 9f2f5bccb1ecceddb5e32b1d4bdca69a45ed07e20114fb7274cf06e06bf9cf05

Contents?: true

Size: 698 Bytes

Versions: 1

Compression:

Stored size: 698 Bytes

Contents

class Shoes
  class Image
    include Common::UIElement
    include Common::Style
    include Common::Clickable

    attr_reader :app, :parent, :dimensions, :gui
    style_with :art_styles, :common_styles, :dimensions, :file_path

    def initialize(app, parent, file_path, styles = {}, blk = nil)
      @app = app
      @parent = parent
      style_init styles, file_path: file_path
      @dimensions = Dimensions.new parent, @style
      @parent.add_child self
      @gui = Shoes.configuration.backend_for self, @parent.gui
      register_click blk
    end

    def path
      @style[:file_path]
    end

    def path=(path)
      style(file_path: path)
      @gui.update_image
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-dsl-4.0.0.pre2 lib/shoes/image.rb