コード例 #1
0
		public void AddOperation(GtkFileOperationProgress progress) {
			VBox subvbox = new VBox();
			Label lbl = new Label();
			subvbox.PackStart(lbl, false, false, 0);
			ProgressBar bar = new ProgressBar();
			bar.Adjustment = new Adjustment(0.0, 0.0, 500.0, 1.0, 1.0, 1.0);
			subvbox.PackStart(bar, true, true, 0);
			vbox.PackStart(subvbox, false, true, 0);
			subvbox.ShowAll();
			
			progress.DisplayWidget = bar;
			progress.Label = lbl;
			progress.Adjustment = bar.Adjustment;
			this.ShowAll();
		}
コード例 #2
0
		public void Finish(GtkFileOperationProgress progress) {
			vbox.Remove(progress.DisplayWidget);
			if(vbox.Children.Length == 0) this.Hide();
		}
コード例 #3
0
		public void ProgressUpdate(GtkFileOperationProgress progress, int current, int max, double proportion, double? bitrate, TimeSpan? etr) {
			progress.Adjustment.Value = 500.0 * proportion;
			progress.Label.Text = FormatLabel(progress.Operation, current, max);
			progress.DisplayWidget.Text = bitrate != null ? string.Format(Catalog.GetString("{0} Remaining"), etr) : null;
		}