Retrieving CList row string
- From: Jeff Shipman <shippy cs nmt edu>
- To: GTK List <gtk-list gnome org>
- Subject: Retrieving CList row string
- Date: Mon, 10 Jul 2000 20:00:55 -0600
I'm trying to retrieve the text string in a CList row, but
I'm having some troubles. Here's the function I'm using:
void add_new_ing(GtkWidget *widget, gpointer data)
{
GList *rows = GTK_CLIST(ing_list)->row_list;
gchar *new_ing = gtk_entry_get_text(GTK_ENTRY(add_entry));
gchar *entry[1] = { new_ing };
if(strcmp(new_ing, "") != 0)
{
/* Duplicate check */
while(rows)
{
GtkCell *tcell = GTK_CLIST_ROW(rows)->cell;
gchar *cur_ing = GTK_CELL_TEXT(tcell)->text;
printf("cur_ing = %s\n", cur_ing);
if(strcmp(new_ing, cur_ing) == 0)
{
printf("DUPLICATE!\n");
}
rows = rows->next;
}
gtk_clist_insert(GTK_CLIST(ing_list), 0, entry);
if(GTK_CLIST(ing_list)->rows)
{
gtk_widget_set_sensitive(sel_ing, TRUE);
}
}
gtk_entry_set_text(GTK_ENTRY(add_entry), "");
}
The problem is that when I do the test print, I get
a bunch of junk. Is there a step I'm missing? I'm trying
to decipher how to do this by reading gtkclist.h.
Any help would be very appreciated. Thanks!
--
+-----------------------------------------------------+
| Jeff "Shippy" Shipman E-Mail: shippy@cs.nmt.edu |
| Computer Science Major ICQ: 1786493 |
| New Mexico Institute of Mining and Technology |
| Homepage: http://www.nmt.edu/~shippy |
+-----------------------------------------------------+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]