Re: GIO and Emblems



2008/12/4 Axel von Bertoldi <bertoldia gmail com>:
> 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?

Someone correct me if I am wrong, but I don't think anything actually
uses this functionality as of yet, so the first step would be to
create something that could possibly give you back a GEmblemedIcon.

-A. Walton

>
> Thanks,
> axel.
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
>


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