comparison gtk/dw.c @ 317:83edbd751da9

Added dw_tree_get_data() to get a tree item's data.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 03 Apr 2003 00:29:46 +0000
parents a07e08f708d6
children aed5d742896d
comparison
equal deleted inserted replaced
316:a07e08f708d6 317:83edbd751da9
3944 DW_MUTEX_UNLOCK; 3944 DW_MUTEX_UNLOCK;
3945 #endif 3945 #endif
3946 } 3946 }
3947 3947
3948 /* 3948 /*
3949 * Gets the item data of a tree item.
3950 * Parameters:
3951 * handle: Handle to the tree containing the item.
3952 * item: Handle of the item to be modified.
3953 */
3954 void *dw_tree_get_data(HWND handle, HWND item)
3955 {
3956 void *ret = NULL;
3957 #if GTK_MAJOR_VERSION > 1
3958 GtkWidget *tree;
3959 GtkTreeStore *store;
3960 int _locked_by_me = FALSE;
3961
3962 if(!handle || !item)
3963 return;
3964
3965 DW_MUTEX_LOCK;
3966 if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)))
3967 && GTK_IS_TREE_VIEW(tree) &&
3968 (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store")))
3969 gtk_tree_model_get(store, (GtkTreeIter *)item, 2, &ret, -1);
3970 DW_MUTEX_UNLOCK;
3971 #else
3972 int _locked_by_me = FALSE;
3973
3974 if(!handle || !item)
3975 return;
3976
3977 DW_MUTEX_LOCK;
3978 ret = (void *)gtk_object_get_data(GTK_OBJECT(item), "itemdata");
3979 DW_MUTEX_UNLOCK;
3980 #endif
3981 return ret;
3982 }
3983
3984 /*
3949 * Sets this item as the active selection. 3985 * Sets this item as the active selection.
3950 * Parameters: 3986 * Parameters:
3951 * handle: Handle to the tree window (widget) to be selected. 3987 * handle: Handle to the tree window (widget) to be selected.
3952 * item: Handle to the item to be selected. 3988 * item: Handle to the item to be selected.
3953 */ 3989 */