Class: Shoes::Progress

Inherits:
Common::UIElement show all
Defined in:
shoes-core/lib/shoes/progress.rb

Constant Summary collapse

STYLES =
{ fraction: 0.0 }.freeze

Constants included from Common::Style

Common::Style::DEFAULT_STYLES, Common::Style::STYLE_GROUPS

Instance Attribute Summary

Attributes inherited from Common::UIElement

#app, #dimensions, #gui, #parent

Instance Method Summary collapse

Methods inherited from Common::UIElement

#add_to_parent, #before_initialize, #create_backend, #create_dimensions, #initialize, #needs_rotate?, #painted?, #redraw_height, #redraw_left, #redraw_top, #redraw_width, #update_fill, #update_stroke

Methods included from Common::Style

#applicable_app_styles, #create_style_hash, included, #style, #style_init

Methods included from Common::SafelyEvaluate

#safely_evaluate

Methods included from Common::Remove

#remove

Methods included from Common::Positioning

#_position, #displace, #move

Methods included from Common::Visibility

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

Methods included from Common::Inspect

#inspect, #to_s

Methods included from Common::Attachable

#attached_to

Constructor Details

This class inherits a constructor from Shoes::Common::UIElement

Instance Method Details

#after_initialize(*_) ⇒ Object


8
9
10
11
# File 'shoes-core/lib/shoes/progress.rb', line 8

def after_initialize(*_)
  @gui.fraction = @style[:fraction]
  update_visibility
end

#fraction=(value) ⇒ Object


17
18
19
20
# File 'shoes-core/lib/shoes/progress.rb', line 17

def fraction=(value)
  style(fraction: value)
  @gui.fraction = value
end

#handle_block(*_) ⇒ Object


13
14
15
# File 'shoes-core/lib/shoes/progress.rb', line 13

def handle_block(*_)
  # No-op since we're not clickable
end