Re: clist & text entry

Hi Castelo

> How I want to grab data from clist(when clicked on it)
> and display it into gtkentry.. anyone.. any idea?

Do you want to display data, which is connected to the cell objects or the
text of the item? Here comes the code for the text:

Somewhere where you construct your dialog

gtk_signal_connect(GTK_OBJECT(clist), "select_row",
	GTK_SIGNAL_FUNC(select_row_event), my_entry);

void select_row_event(GtkWidget *clist, gint row, gint column,
GdkEventButton *event, gpointer user_data)
   gchar* line;
   gtk_clist_get_text(GTK_CLIST(clist), row, column, &line);
   gtk_entry_set_text(GTK_ENTRY(my_entry), line);

I'm not shure if you have to free the line with g_free(line).
Just try it.



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