Class: NodeWidget
- Inherits:
-
Shoes::Widget
- Object
- Shoes::Widget
- NodeWidget
- Defined in:
- lib/shoes/profiler.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ NodeWidget
constructor
A new instance of NodeWidget.
Constructor Details
#initialize(options = {}) ⇒ NodeWidget
Returns a new instance of NodeWidget.
151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/shoes/profiler.rb', line 151 def initialize(={}) name, method_info = [:node] size = [:size]*8 ca = [:color_alpha] infos = [:info] self.width = size+4; self.height = size/2+4 stack width: size+4, height: size/2+4 do oval 2,2, size, size/2, fill: ca == 1.0 ? red : red(ca) @n = inscription "#{name}\n#{infos}", font: "mono", align: "center", margin: 0, displace_top: (size/4)-8 end end |