ProgressBar (Vala) Tiffany Antopolski tiffany.antopolski@gmail.com 2012 Ένα γραφικό στοιχείο που δείχνει την πρόοδο οπτικά Ελληνική μεταφραστική ομάδα GNOME team@gnome.gr 2012-2015 Δημήτρης Σπίγγος dmtrs32@gmail.com 2012, 2013 Μαρία Θουκιδίδου marablack3@gmail.com 2014 Θάνος Τρυφωνίδης tomtryf@gmail.com 2014, 2015 Γραμμή προόδου (ProgressBar)

Αυτή η ProgressBar "γεμίζει" με ένα κλάσμα της γραμμής μέχρι να γεμίσει.

public class MyApplication : Gtk.Application { Gtk.ProgressBar progress_bar; protected override void activate () { var window = new Gtk.ApplicationWindow (this); window.set_title ("ProgressBar Example"); window.set_default_size (220, 20); progress_bar = new Gtk.ProgressBar (); window.add (progress_bar); window.show_all (); double fraction = 0.0; progress_bar.set_fraction (fraction); GLib.Timeout.add (500, fill); } bool fill () { double fraction = progress_bar.get_fraction (); //get current progress fraction += 0.1; //increase by 10% each time this function is called progress_bar.set_fraction (fraction); /* This function is only called by GLib.Timeout.add while it returns true; */ if (fraction < 1.0) return true; return false; } } public int main (string[] args) { var progress_bar_application = new MyApplication (); int status = progress_bar_application.run (args); return status; }

Σε αυτό το παράδειγμα χρησιμοποιήσαμε τα παρακάτω:

Gtk.ProgressBar

GLib.Timeout