tooltip on gdk_pixbuf in gtk_icon_view



Hi,

I have an icon_view with gdk_pixbuf only. To avoid alignment
problems with the text under the icon in the iconview I thought to use
a tooltip showing what the icon is for:

prefs_data->prefs_liststore = gtk_list_store_new ( 2, GDK_TYPE_PIXBUF,
G_TYPE_UINT);
        prefs_iconview =
gtk_icon_view_new_with_model(GTK_TREE_MODEL(prefs_data->prefs_liststore));
        g_object_unref (prefs_data->prefs_liststore);

        gtk_widget_set_size_request(prefs_iconview, 80, 140);
        gtk_icon_view_set_orientation (GTK_ICON_VIEW (prefs_iconview),
GTK_ORIENTATION_VERTICAL);
        gtk_icon_view_set_columns (GTK_ICON_VIEW (prefs_iconview),1);
        gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (prefs_iconview), 0);
        gtk_container_add (GTK_CONTAINER (scrolledwindow1), prefs_iconview);

        gtk_list_store_append (prefs_data->prefs_liststore, &iter);
    icon_pixbuf = gtk_widget_render_icon (prefs_iconview,
"gtk-execute", GTK_ICON_SIZE_DND, NULL);
        gtk_list_store_set (prefs_data->prefs_liststore, &iter, 0,
icon_pixbuf, 1,2,-1);
        gtk_tooltips_set_tip(tooltips, icon_pixbuf, _("View"), NULL);
        g_object_unref (icon_pixbuf);
        gtk_widget_show (prefs_iconview);

I get errors during runtime because I can't set a tooltip that way on
a gdk_pixbuf, can someone help me please?
--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
Xscreencast, a DE independent desktop session recorder - http://xscreencast.berlios.de
Cpsed, a Linux OpenGL 3D scene editor - http://cpsed.sourceforge.net



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