diff gtk/dw.c @ 90:eeb98f881663

Committed the dw_window_set/get_data() changes from the FX tree.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 22 Apr 2002 08:34:35 +0000
parents 1eb72c0e8c79
children 67cd8e97ef8c
line wrap: on
line diff
--- a/gtk/dw.c	Fri Apr 19 17:52:38 2002 +0000
+++ b/gtk/dw.c	Mon Apr 22 08:34:35 2002 +0000
@@ -5778,6 +5778,46 @@
 		windowfunc(data);
 }
 
+/*
+ * Add a named user data item to a window handle.
+ * Parameters:
+ *       window: Window handle of signal to be called back.
+ *       dataname: A string pointer identifying which signal to be hooked.
+ *       data: User data to be passed to the handler function.
+ */
+void dw_window_set_data(HWND window, char *dataname, void *data)
+{
+	int _locked_by_me = FALSE;
+
+	if(!window)
+		return;
+
+	DW_MUTEX_LOCK;
+	gtk_object_set_data(GTK_OBJECT(window),  dataname, (gpointer)data);
+	DW_MUTEX_UNLOCK;
+}
+
+/*
+ * Gets a named user data item to a window handle.
+ * Parameters:
+ *       window: Window handle of signal to be called back.
+ *       dataname: A string pointer identifying which signal to be hooked.
+ *       data: User data to be passed to the handler function.
+ */
+void *dw_window_get_data(HWND window, char *dataname)
+{
+	int _locked_by_me = FALSE;
+	void *ret;
+
+	if(!window)
+		return;
+
+	DW_MUTEX_LOCK;
+	ret = (void *)gtk_object_set_data(GTK_OBJECT(window),  dataname);
+	DW_MUTEX_UNLOCK;
+	return ret;
+}
+
 #ifndef NO_SIGNALS
 /*
  * Add a callback to a window event.