[gnome-devel-docs] Undid changes made to make video in previous commit.
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Undid changes made to make video in previous commit.
- Date: Sun, 17 Jun 2012 02:42:14 +0000 (UTC)
commit 52093abe8a013695aae5824831e585b432110103
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Sat Jun 16 22:41:39 2012 -0400
Undid changes made to make video in previous commit.
platform-demos/C/samples/progressbar.vala | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/platform-demos/C/samples/progressbar.vala b/platform-demos/C/samples/progressbar.vala
index 7ad6941..ccf3849 100644
--- a/platform-demos/C/samples/progressbar.vala
+++ b/platform-demos/C/samples/progressbar.vala
@@ -5,7 +5,6 @@ public class MyApplication : Gtk.Application {
protected override void activate () {
var window = new Gtk.ApplicationWindow (this);
window.set_title ("ProgressBar Example");
- window.set_position (Gtk.WindowPosition.CENTER);
window.set_default_size (220, 20);
progress_bar = new Gtk.ProgressBar ();
@@ -15,20 +14,18 @@ public class MyApplication : Gtk.Application {
double fraction = 0.0;
progress_bar.set_fraction (fraction);
GLib.Timeout.add (500, fill);
- this.quit ();
}
bool fill () {
- double fraction = progress_bar.get_fraction ();
- fraction += 0.1; //increase by 10%
+ 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; */
+ /* This function is only called by GLib.Timeout.add while it returns true; */
if (fraction < 1.0)
return true;
- else progress_bar.set_fraction (0.0);
- return true;
+ return false;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]