Re: Oddities w/a clist

>Delivered-To: gtk-list gnome org
>Date: Wed, 18 Oct 2000 22:31:30 -0600
>From: Jeff Shipman <shippy cs nmt edu>
>Organization: New Mexico Institute of Mining and Technology
>User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16 i686; en-US; m18) Gecko/20000912
>X-Accept-Language: en
>X-BeenThere: gtk-list gnome org
>X-Loop: gtk-list gnome org
>X-Mailman-Version: 2.0beta5
>Precedence: bulk
>List-Id: General discussion of GTK+ <>
>I've used clists many times in the past with no problem, but
>for some reason, when I run the following code:
>tmp = gtk_scrolled_window_new(NULL, NULL);
>gtk_widget_set_usize(tmp, 1, 100);
>gtk_box_pack_start(GTK_BOX(vbox2), tmp, TRUE, TRUE, 0);
>ilist = gtk_clist_new_with_titles(3, titles);
>gtk_clist_set_column_width(GTK_CLIST(ilist), 0, 100);
>gtk_clist_set_column_width(GTK_CLIST(ilist), 1, 300);
>gtk_clist_set_column_width(GTK_CLIST(ilist), 2, 50);
>gtk_clist_set_sort_type(GTK_CLIST(ilist), GTK_SORT_ASCENDING);
>gtk_clist_set_auto_sort(GTK_CLIST(ilist), TRUE);
>gtk_clist_set_sort_column(GTK_CLIST(ilist), 1);
>gtk_container_add(GTK_CONTAINER(tmp), ilist);
>gtk_clist_set_text(GTK_CLIST(ilist), 0, 0, "TESTING!");
>I cannot get "TESTING!" to appear anywhere in the clist. I
>must be forgetting something really obvious, but I'm really
>having trouble discerning what that is. If anybody could
>offer a suggestion, I would really appreciate it. Thanks!
>Oh yeah, the clist and all of the columns and titles are
>shown with no problem. I'm using GTK+ 1.2.8
>Jeff "Shippy" Shipman     E-Mail: shippy cs nmt edu
>CS Major / EE Minor       ICQ: 1786493
>New Mexico Institute of Mining and Technology
>gtk-list mailing list
>gtk-list gnome org

GTK simply ignores setting text in a sell, that does not exist. You
should call gtk_clist_append() first. Here is an excerpt from
gtkclist.c, that proves it:

  if (row < 0 || row >= clist->rows)
  if (column < 0 || column >= clist->columns)

Vladimir V. Tsichevski
senior expert

                  Jet Infosystems
Krasnoproletarskaya 6,		Tel. (+7 095) 972-1182
Moscow 103006, Russia		Fax  (+7 095) 972-0791
Any opinions or recommendations herein are those of
the author and not of his computer.

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