Problem With Setting GtkCellRendererText in a Tree View..



hi all...


Currently i am having a problem with updation of GtkCellRendererText
field.
What i want to do:
        Update a particular field in a list of rows.
        After that update that to database on click of a button.



I have connected the "edited" signal to the particular column which
i want to edit, so that whenever a edited is emited,
i will get the text inside the Callback for the edited signal,
and i set it back to the particular GtkStore.


AS*********code******


static void


cell_edited (GtkCellRendererText *cellrenderertext,
             gchar *path_str,gchar *arg2,gpointer data)
{


  GtkTreeModel *model = (GtkTreeModel *)data;
  GtkTreePath *path = gtk_tree_path_new_from_string (path_str);
  GtkTreeIter iter;


  gint *column;


  column = g_object_get_data (G_OBJECT (cellrenderertext), "column");
  /* get toggled iter */
  gtk_tree_model_get_iter (model, &iter, path);
  /* set new value */
  gtk_tree_store_set (GTK_TREE_STORE (model), &iter, column,
                      arg2, -1);
        printf("%s\n",arg2);


    gtk_tree_path_free (path);
  return;


}


**************************************
But my problem is that i get the "edited" signal only when a
'enter' or 'tab' key is pressed or I click on the tree view.
(But a user may click on the 'OK' button after editing the last row's cell.
 In which case he will lose the last cell's data.)


So is it possible to prompt an emition of "edited" signal on the cell
on 'OK' button clicked ?


Or is there any other way to set the GtkCellRendererText....in such a 
situation.



Thanks for any help...


Regards,
Bijoy.






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