Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
89:ec311fe773da | 90:eeb98f881663 |
---|---|
5776 | 5776 |
5777 if(windowfunc) | 5777 if(windowfunc) |
5778 windowfunc(data); | 5778 windowfunc(data); |
5779 } | 5779 } |
5780 | 5780 |
5781 /* | |
5782 * Add a named user data item to a window handle. | |
5783 * Parameters: | |
5784 * window: Window handle of signal to be called back. | |
5785 * dataname: A string pointer identifying which signal to be hooked. | |
5786 * data: User data to be passed to the handler function. | |
5787 */ | |
5788 void dw_window_set_data(HWND window, char *dataname, void *data) | |
5789 { | |
5790 int _locked_by_me = FALSE; | |
5791 | |
5792 if(!window) | |
5793 return; | |
5794 | |
5795 DW_MUTEX_LOCK; | |
5796 gtk_object_set_data(GTK_OBJECT(window), dataname, (gpointer)data); | |
5797 DW_MUTEX_UNLOCK; | |
5798 } | |
5799 | |
5800 /* | |
5801 * Gets a named user data item to a window handle. | |
5802 * Parameters: | |
5803 * window: Window handle of signal to be called back. | |
5804 * dataname: A string pointer identifying which signal to be hooked. | |
5805 * data: User data to be passed to the handler function. | |
5806 */ | |
5807 void *dw_window_get_data(HWND window, char *dataname) | |
5808 { | |
5809 int _locked_by_me = FALSE; | |
5810 void *ret; | |
5811 | |
5812 if(!window) | |
5813 return; | |
5814 | |
5815 DW_MUTEX_LOCK; | |
5816 ret = (void *)gtk_object_set_data(GTK_OBJECT(window), dataname); | |
5817 DW_MUTEX_UNLOCK; | |
5818 return ret; | |
5819 } | |
5820 | |
5781 #ifndef NO_SIGNALS | 5821 #ifndef NO_SIGNALS |
5782 /* | 5822 /* |
5783 * Add a callback to a window event. | 5823 * Add a callback to a window event. |
5784 * Parameters: | 5824 * Parameters: |
5785 * window: Window handle of signal to be called back. | 5825 * window: Window handle of signal to be called back. |