tooltip on gdk_pixbuf in gtk_icon_view
- From: Giuseppe Torelli <torelli szn it>
- To: gtk-app-devel-list gnome org
- Subject: tooltip on gdk_pixbuf in gtk_icon_view
- Date: Thu, 08 Feb 2007 12:24:25 +0100
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?
--
Giuseppe Torelli
Bioinformatics Programmer
Laboratory of Molecular Evolution
Stazione Zoologica Anton Dohrn
Villa Comunale 80121 Naples - Italy
Tel 0039 81 5833428
Tel 0039 81 7641355
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]