GtkTextView how about a "row_selected" signal?



There is a signal for doubleclicks called "row_activated" but sometimes
you also need to now when a row is selected:

An example is a file selector where you want to update the GtkEntry 
when you select a file/dir.

Below is a patch adding a new signal called "row_selected" 
is this ok to submit?

Greets

M.H.

----------------------------------------------------------------------------------------------

Index: gtk+/gtk/gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.145
diff -r1.145 gtktreeview.c
98a99
>   ROW_SELECTED,
622a624,633
>   tree_view_signals[ROW_SELECTED] =
>     gtk_signal_new ("row_selected",
> 		    GTK_RUN_LAST | GTK_RUN_ACTION,
> 		    GTK_CLASS_TYPE (object_class),
> 		    GTK_SIGNAL_OFFSET (GtkTreeViewClass, row_selected),
> 		    gtk_marshal_VOID__BOXED_OBJECT,
> 		    GTK_TYPE_NONE, 2,
> 		    GTK_TYPE_TREE_PATH,
> 		    GTK_TYPE_TREE_VIEW_COLUMN);
> 
1529a1541
> 
7211a7224,7232
> void
> gtk_tree_view_row_selected (GtkTreeView       *tree_view,
> 			     GtkTreePath       *path,
> 			     GtkTreeViewColumn *column)
> {
>   g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
> 
>   g_signal_emit (G_OBJECT(tree_view), tree_view_signals[ROW_SELECTED], 0,
path, column);
> }
7826a7848,7849
> 
>   gtk_tree_view_row_selected (tree_view, path, NULL);
Index: gtk+/gtk/gtktreeview.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.h,v
retrieving revision 1.37
diff -r1.37 gtktreeview.h
73a74,76
>   void     (* row_selected)              (GtkTreeView       *tree_view,
> 				           GtkTreePath       *path,
> 					   GtkTreeViewColumn *column);




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