sparklediff: update controls when shown

This commit is contained in:
Hylke Bons 2010-07-04 02:00:16 +01:00
parent 43dc8b5f6e
commit 3de52cd4ee

View file

@ -415,7 +415,9 @@ namespace SparkleShare {
PackStart (controls, false, false, 0);
PackStart (ScrolledWindow, true, true, 0);
UpdateControls ();
Shown += delegate {
UpdateControls ();
};
}
@ -434,7 +436,7 @@ namespace SparkleShare {
if (ComboBox.Active - 1 >= 0)
ComboBox.Active--;
UpdateControls ();
// UpdateControls ();
}
@ -444,7 +446,7 @@ namespace SparkleShare {
if (ComboBox.Active + 1 < ValueCount)
ComboBox.Active++;
UpdateControls ();
// UpdateControls ();
}
@ -456,6 +458,19 @@ namespace SparkleShare {
ButtonNext.State = StateType.Normal;
// TODO: Disable Next or Previous buttons when at the first or last value of the combobox
// I can't get this to work! >:(
if (ComboBox.Active == ValueCount - 1) {
ButtonPrevious.State = StateType.Insensitive;
Console.WriteLine ("BEGINNING REACHED");
}
// FAULT IS HERE
if (ComboBox.Active == 0) {
Console.WriteLine ("END REACHED");
ButtonNext.State = StateType.Insensitive;
}
}