P
Patrick Plattes
Hello,
i have some problems with the Gtk:rogressBar. I download a file and i
want to show a progressbar. The method below creates a new dialog with a
bar and starts the download for each file. The puts-line work very well
and i can see a dialog, there is no update. Does anybody know whats
going wrong?
Thanks to all the people in this great community,
Patrick
def download_podcasts(liststore_podcasts)
dialog = Gtk:ialog.new("Download",
$main_application_window,
Gtk:ialog:ESTROY_WITH_PARENT)
bar = Gtk:rogressBar.new
bar.fraction = 0.0
dialog.vbox.add(bar)
dialog.show_all
liststore_podcasts.each do |model,path,row|
row[3].download do |received, total|
bar.fraction = received.to_f / total.to_f
bar.text = (bar.fraction * 100).to_s + "%"
puts received.to_s + " / " + total.to_s + " = "
+ bar.fraction.to_s
end
end
dialog.destroy
end
i have some problems with the Gtk:rogressBar. I download a file and i
want to show a progressbar. The method below creates a new dialog with a
bar and starts the download for each file. The puts-line work very well
and i can see a dialog, there is no update. Does anybody know whats
going wrong?
Thanks to all the people in this great community,
Patrick
def download_podcasts(liststore_podcasts)
dialog = Gtk:ialog.new("Download",
$main_application_window,
Gtk:ialog:ESTROY_WITH_PARENT)
bar = Gtk:rogressBar.new
bar.fraction = 0.0
dialog.vbox.add(bar)
dialog.show_all
liststore_podcasts.each do |model,path,row|
row[3].download do |received, total|
bar.fraction = received.to_f / total.to_f
bar.text = (bar.fraction * 100).to_s + "%"
puts received.to_s + " / " + total.to_s + " = "
+ bar.fraction.to_s
end
end
dialog.destroy
end