gtk_tree_model_get to get value from a column which type is GDK_TYPE_COLOR ?



Dear sirs:
    I use gtk_tree_model_get to get a column value, which type is GDK_TYPE_COLOR

    GdkColor *forecolor;
    gtk_tree_model_get(mode, &iter,COLUMN_COLOR, &forecolor,-1);
    printf("red=%d,green=%d,blue=%d\n",forecolor->red,forecolor->green,forecolor->blue);

this show out the color are correct, but how can I free forecolor?
g_free and g_value_unset both fail to free it.
the docs said after get G_TYPE_STRING value, should use g_free to free the string.

thanks.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]