[Glade-users] selected row






Hi Guenther,
I got another doubt though.  I got a list (GtkStore), where I show some
data.
I wanted to show the properties of a highlighted list item on the click
of a button.  To do that I need to get some reference to the highlighted
row, but I can't find the right signal to it..
...

I used the button_release event for this. I'll append you my callback
function. It reads out a single (!!!) line from a GtkTreeview:


gboolean
on_treeview_button_release_event(GtkWidget       *widget,
                         GdkEventButton  *event,
                         gpointer         user_data)
{
  GtkTreeSelection  *selection;
  GtkTreeView       *tree_view;
  GList             *sel_row_list;
  char              *dummy;

  if(event->type =3D=3D GDK_BUTTON_RELEASE)
    {
      printf("    button %d\n", event->button);


      tree_view =3D GTK_TREE_VIEW(lookup_widget(widget,
                                    "treeview_name"));

      selection =3D gtk_tree_view_get_selection(tree_view);
      sel_row_list =3D gtk_tree_selection_get_selected_rows(selection,
                                            NULL);
      dummy =3D gtk_tree_path_to_string((GtkTreePath*) sel_row_list->data);
      printf("    selected row: %s\n", dummy);

      g_free(dummy);
    }


  return FALSE;
}

hope this helps...
Franz
-----------------------------------------------------
Franz Parzefall
Vision Systems

Multitest elektronische Systeme GmbH
Aeussere Oberaustra=DFe 4
D - 83026 Rosenheim
Tel. +49-(0)8031-406-356
Fax +49-(0)8031-406-148
-----------------------------------------------------



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************




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