From 46007cfd1765c8df8195e272c061a270b22fdfe0 Mon Sep 17 00:00:00 2001 From: Jeroen Zwartepoorte Date: Thu, 10 Feb 2005 21:50:50 +0000 Subject: [PATCH] 2005-02-10 Jeroen Zwartepoorte * sample/Actions.cs: Remove obsolete & unsafe GLib.Object.Data usage. svn path=/trunk/gtk-sharp/; revision=40441 --- ChangeLog | 4 ++++ sample/Actions.cs | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d686b7adc..abd9f0024 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-02-10 Jeroen Zwartepoorte + + * sample/Actions.cs: Remove obsolete & unsafe GLib.Object.Data usage. + 2005-02-10 Mike Kestner * configure.in : update version for 1.9.2 release. diff --git a/sample/Actions.cs b/sample/Actions.cs index 43370238f..7feade6d1 100644 --- a/sample/Actions.cs +++ b/sample/Actions.cs @@ -8,6 +8,7 @@ namespace GtkSamples { using Gtk; using System; + using System.Collections; public class Actions { static VBox box = null; @@ -18,6 +19,7 @@ namespace GtkSamples { static ActionGroup dynGroup = null; static uint mergeId = 0; static UIManager uim = null; + static Hashtable actions = new Hashtable (); /* XML description of the menus for the test app. The parser understands * a subset of the Bonobo UI XML format, and uses GMarkup for parsing */ @@ -297,7 +299,7 @@ namespace GtkSamples { static void OnSelect (object obj, EventArgs args) { - Action action = ((GLib.Object)obj).Data["action"] as Action; + Action action = (Action) actions[obj]; if (action.Tooltip != null) statusbar.Push (0, action.Tooltip); } @@ -310,7 +312,7 @@ namespace GtkSamples { static void OnProxyConnect (object obj, ConnectProxyArgs args) { if (args.Proxy is MenuItem) { - ((GLib.Object)args.Proxy).Data ["action"] = args.Action; + actions[args.Proxy] = args.Action; ((Item)args.Proxy).Selected += new EventHandler (OnSelect); ((Item)args.Proxy).Deselected += new EventHandler (OnDeselect); }