[f-spot] Use the protected override for Realied/Unrealized
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] Use the protected override for Realied/Unrealized
- Date: Wed, 17 Jun 2009 04:19:43 -0400 (EDT)
commit a372b233ac285891cd700a0d41ba599ae323d881
Author: Stephane Delcroix <stephane delcroix org>
Date: Tue Jun 16 13:35:30 2009 +0200
Use the protected override for Realied/Unrealized
src/PhotoImageView.cs | 33 ++++++++-------------------------
1 files changed, 8 insertions(+), 25 deletions(-)
---
diff --git a/src/PhotoImageView.cs b/src/PhotoImageView.cs
index cef140f..815609a 100644
--- a/src/PhotoImageView.cs
+++ b/src/PhotoImageView.cs
@@ -37,11 +37,7 @@ namespace FSpot.Widgets {
Accelerometer.OrientationChanged += HandleOrientationChanged;
- HandleRealized (null, null);
-
this.KeyPressEvent += HandleKeyPressEvent;
- //this.Realized += HandleRealized;
- this.Unrealized += HandleUnrealized;
this.ScrollEvent += HandleScrollEvent;
this.item = item;
item.Changed += PhotoItemChanged;
@@ -54,28 +50,12 @@ namespace FSpot.Widgets {
}
new public BrowsablePointer Item {
- get {
- return item;
- }
+ get { return item; }
}
private IBrowsableCollection query;
public IBrowsableCollection Query {
- get {
- return item.Collection;
- }
-#if false
- set {
- if (query != null) {
- query.Changed -= HandleQueryChanged;
- query.ItemsChanged -= HandleQueryItemsChanged;
- }
-
- query = value;
- query.Changed += HandleQueryChanged;
- query.ItemsChanged += HandleQueryItemsChanged;
- }
-#endif
+ get { return item.Collection; }
}
public Loupe Loupe {
@@ -101,8 +81,7 @@ namespace FSpot.Widgets {
PhotoItemChanged (Item, null);
}
- [GLib.ConnectBefore]
- private void HandleRealized (object sender, EventArgs args)
+ protected override void OnRealized ()
{
int [] attr = new int [] {
(int) GdkGlx.GlxAttribute.Rgba,
@@ -117,10 +96,14 @@ namespace FSpot.Widgets {
} catch (GdkGlx.GlxException e) {
Console.WriteLine ("Error initializing the OpenGL context:{1} {0}", e, Environment.NewLine);
}
+
+ base.OnRealized ();
}
- private void HandleUnrealized (object sender, EventArgs args)
+ protected override void OnUnrealized ()
{
+ base.OnUnrealized ();
+
if (Glx != null)
Glx.Destroy ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]