Patrick Plattes
12/3/2006 10:52:00 AM
Hello,
i have some problems with the Gtk::ProgressBar. 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::Dialog.new("Download",
$main_application_window,
Gtk::Dialog::DESTROY_WITH_PARENT)
bar = Gtk::ProgressBar.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