Class: JLDrill::Gtk::FileProgress
Instance Attribute Summary collapse
#context
Instance Method Summary
collapse
#addView, #removeView, #removingViewFrom, #viewAddedTo
Constructor Details
Returns a new instance of FileProgress.
12
13
14
15
16
17
18
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 12
def initialize(context)
super(context)
@progressBar = ProgressBar.new(self)
@progressBar.expandWidgetWidth
@block = nil
@id = nil
end
|
Instance Attribute Details
#progressWindow ⇒ Object
Returns the value of attribute progressWindow.
10
11
12
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 10
def progressWindow
@progressWindow
end
|
Instance Method Details
#filename ⇒ Object
24
25
26
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 24
def filename
return File.basename(@context.getFilename)
end
|
20
21
22
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 20
def getWidget
@progressBar
end
|
#idle_add(&block) ⇒ Object
47
48
49
50
51
52
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 47
def idle_add(&block)
if @block.nil? && @id.nil?
@block = block
@id = Gtk.idle_add do run end
end
end
|
#run ⇒ Object
32
33
34
35
36
37
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 32
def run
if @block.call
stop
end
return true
end
|
#stop ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 39
def stop
if !@id.nil?
Gtk.idle_remove(@id)
@id = nil
@block = nil
end
end
|
#update(fraction) ⇒ Object
28
29
30
|
# File 'lib/jldrill/views/gtk/FileProgress.rb', line 28
def update(fraction)
@progressBar.update(fraction)
end
|