Sha256: 1a03300f8c5f578b32a405db8863125f66eb2b4f5756614e29ea64dd5b2c3b25
Contents?: true
Size: 1017 Bytes
Versions: 1
Compression:
Stored size: 1017 Bytes
Contents
# encoding: utf-8 require 'jldrill/contexts/FileProgressContext' require 'jldrill/views/gtk/widgets/ProgressBar' require 'gtk2' module JLDrill::Gtk class FileProgress < JLDrill::FileProgressContext::FileProgress attr_reader :progressWindow def initialize(context) super(context) @progressBar = ProgressBar.new(self) @progressBar.expandWidgetWidth @block = nil @id = nil end def getWidget @progressBar end def filename return File.basename(@context.getFilename) end def update(fraction) @progressBar.update(fraction) end def run if @block.call stop end return true end def stop if !@id.nil? Gtk.idle_remove(@id) @id = nil @block = nil end end def idle_add(&block) if @block.nil? && @id.nil? @block = block @id = Gtk.idle_add do run end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jldrill-0.6.0.1 | lib/jldrill/views/gtk/FileProgress.rb |