class Widgets::Time
A time widget.
- format:
-
Takes a Time#strftime format string. See Formats for Dates and times. Default is +%H:%M:%S+.
Public Class Methods
Source
# File src/widgets/time.rb, line 10 def initialize options options[:interval] ||= 1 super @options[:format] ||= '%H:%M:%S' @label = Gtk::Label.new '' init_timer append @label end
Calls superclass method
Widgets::Widget::new
Public Instance Methods
Source
# File src/widgets/time.rb, line 18 def update @label.set_text Time.now.strftime(@options[:format]) end