Re: Double-click on a Treeview



Hi!

On Wed, 6 Nov 2002, David Goncalves wrote:

Hi,

Does any one have an example of how to track single/double
clicks on a treeview item.


g_signal_connect (G_OBJECT (treeview), "row_activated",
                        G_CALLBACK  (on_treeview1_row_activated),
                        NULL);

gboolean
on_treeview1_row_activated             (GtkTreeView     *treeview,
                                        GtkTreePath     *arg1,
                                        GtkTreeViewColumn *arg2,
                                        gpointer         user_data)
{
  GtkTreeSelection *selection;
  GtkTreeModel *model;
  GtkTreeIter iter;

  selection=gtk_tree_view_get_selection(treeview);
  if (gtk_tree_selection_get_selected (selection, &model, &iter))
  {
  //do the job
  return TRUE;
  }
  return FALSE;
}




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