Class: Shoes::Swt::Background

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Common::Fill, Common::Remove, Common::Stroke, Common::Translate, Common::Visibility
Defined in:
shoes-swt/lib/shoes/swt/background.rb

Defined Under Namespace

Classes: Painter

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common::Translate

#clear_translate, #translate_left, #translate_top

Methods included from Common::Visibility

#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?

Methods included from Common::Remove

#remove

Methods included from Common::Stroke

#update_stroke

Methods included from Common::Fill

#update_fill

Constructor Details

#initialize(dsl, app) ⇒ Background

Returns a new instance of Background


18
19
20
21
22
23
24
25
26
27
# File 'shoes-swt/lib/shoes/swt/background.rb', line 18

def initialize(dsl, app)
  @dsl = dsl
  @app = app

  # fill is potentially a pattern that needs disposing, so hold onto it
  @fill = dsl.fill

  @painter = Painter.new(self)
  @app.add_paint_listener @painter
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app


16
17
18
# File 'shoes-swt/lib/shoes/swt/background.rb', line 16

def app
  @app
end

#dslObject (readonly)

Returns the value of attribute dsl


16
17
18
# File 'shoes-swt/lib/shoes/swt/background.rb', line 16

def dsl
  @dsl
end

#painterObject (readonly)

Returns the value of attribute painter


16
17
18
# File 'shoes-swt/lib/shoes/swt/background.rb', line 16

def painter
  @painter
end

#transformObject (readonly)

Returns the value of attribute transform


16
17
18
# File 'shoes-swt/lib/shoes/swt/background.rb', line 16

def transform
  @transform
end

Instance Method Details

#cornersObject


29
30
31
# File 'shoes-swt/lib/shoes/swt/background.rb', line 29

def corners
  dsl.curve
end

#disposeObject


33
34
35
# File 'shoes-swt/lib/shoes/swt/background.rb', line 33

def dispose
  @fill.gui.dispose if @fill && @fill.respond_to?(:gui)
end