tests: Use accessor functions to access GtkSelectionData

This commit is contained in:
Javier Jardón
2010-12-15 23:47:45 +00:00
parent 67f6a43702
commit 7105e8e907
5 changed files with 34 additions and 27 deletions

View File

@ -8917,19 +8917,19 @@ create_snapshot (GtkWidget *widget)
void
selection_test_received (GtkWidget *tree_view,
GtkSelectionData *data)
GtkSelectionData *selection_data)
{
GtkTreeModel *model;
GtkListStore *store;
GdkAtom *atoms;
int i, l;
if (data->length < 0)
if (gtk_selection_data_get_length (selection_data) < 0)
{
g_print ("Selection retrieval failed\n");
return;
}
if (data->type != GDK_SELECTION_TYPE_ATOM)
if (gtk_selection_data_get_data_type (selection_data) != GDK_SELECTION_TYPE_ATOM)
{
g_print ("Selection \"TARGETS\" was not returned as atoms!\n");
return;
@ -8943,9 +8943,9 @@ selection_test_received (GtkWidget *tree_view,
/* Add new items to list */
atoms = (GdkAtom *)data->data;
gtk_selection_data_get_targets (selection_data,
&atoms, &l);
l = data->length / sizeof (GdkAtom);
for (i = 0; i < l; i++)
{
char *name;