Why the code is not compatible?



Hi, ALL,

[code]
#if GTK_CHECK_VERSION( 3, 10, 0 )
        if( !gtk_check_version( 3, 10, 0 ) )
        {
        GtkIconTheme *theme = gtk_icon_theme_get_default();
        GError *error = NULL;
        GdkPixbuf *pixbuf = gtk_icon_theme_load_icon( theme,
"dialog-error", GTK_ICON_SIZE_DIALOG,
GTK_ICON_LOOKUP_GENERIC_FALLBACK, &error );
        if( !pixbuf )
        {
            g_warning( "Couldn't find the icon" );
        g_error_free( error );
        }
        else
        {
            image = gtk_image_new_from_pixbuf( pixbuf );
        g_object_unref( pixbuf );
        }
//            image = gtk_image_new_from_icon_name( "dialog-error",
GTK_ICON_SIZE_DIALOG );
        }
        else
#endif
        {
            wxGCC_WARNING_SUPPRESS(deprecated-declarations);
            image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR,
GTK_ICON_SIZE_DIALOG);
        wxGCC_WARNING_RESTORE()
        }
        gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 12);
[/code]

When I compile this code on GTK+3 the image is very small. However, if
I explicitely put 48 instead of GTK_ICON_SIZE_DIALOG in  the call to
gtk_icon_theme_load_icon() or
use gtk_image_new_from_icon_name() instead of the whole block the icon
appears properly sized.

Is there a reason for that?

Thank you.


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