GIO and Emblems



Hi There,

I'm wondering how one can ultimately render an mime icon for a file (as a gtk image or something) including any emblems associated with the file.

I'm getting the GIcon for the file and creating a gtk image from it using the code below:

GFileEnumerator *enumerator = g_file_enumerate_children (file,
                                                             G_FILE_ATTRIBUTE_STANDARD_ICON,
                                                             0, NULL, &error);

    GFileInfo *file_info = NULL;
    while ((file_info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL) {
        GIcon *icon = g_file_info_get_icon (file_info);
        GtkWidget *icon_widget = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
}

Checking for emblems with either of the following always return FALSE:

G_IS_EMBLEMED_ICON (icon));
G_IS_EMBLEM (icon));

Again, how does one access and render any emblems associated with a file?

Thanks,
axel.


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