[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: gtk_icon_view enter and leave signals like in gtk_button
- From: "Tadej Borovšak" <tadeboro gmail com>
- To: gtk-app-devel-list gnome org
- Subject: Re: gtk_icon_view enter and leave signals like in gtk_button
- Date: Sat, 29 Nov 2008 00:43:46 +0100
Hello.
For displaying the tooltips on your items, you can simply create new
column in your iconview's model that holds tooltip texts, call
gtk_icon_view_set_tooltip_column and you're done. (Reference docs:
http://library.gnome.org/devel/gtk/stable/GtkIconView.html#gtk-icon-view-set-tooltip-column)
As for the single click, I would suggest connecting GtkIconView's
"button-press-event" to some function, in which you obtain clicked
item with gtk_icon_view_get_path_at_pos. (Reference docs:
http://library.gnome.org/devel/gtk/stable/GtkIconView.html#gtk-icon-view-get-path-at-pos)
A prototype of a callback function should look something like this:
============
static gboolean
cb_button_press( GtkWidget *view,
GdkeventButton *event,
gpointer data )
{
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeModel *model;
path = gtk_icon_view_get_path_at_pos( GTK_ICON_VIEW( view ),
event->x, event->y );
model = gtk_icon_view_get_model( GTK_ICON_VIEW( view ) );
gtk_tree_model_get_iter( model, path, &iter );
gtk_tree_path_free( path );
/* Manipulate your code further */
return( FALSE );
}
=============
2008/11/29 Vasiliy G Tolstov <v tolstov selfip ru>:
> I'm write program that displays plugins in icon_view, i want to display
> description when the mouse cursor on sample icon, and execute some code
> then the user take single click on it.
> Does it possible with icon_view? I need signals like in gtk_button...
>
> --
> Vasiliy G Tolstov <v tolstov selfip ru>
> Selfip.Ru
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
--
Tadej Borovšak
00386 (0)40 613 131
tadeboro gmail com
tadej borovsak gmail com
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]