Re: Oddities w/a clist



I got it to work by quickly adding:

  titles[0] = "";
  titles[1] = "";
  titles[2] = "";
  gtk_clist_append(GTK_CLIST(ilist),titles);

just before
  gtk_clist_set_text(GTK_CLIST(ilist), 0, 0, "TESTING!");

which goes to prove Vladimir's point. Of course for real
production, I would not use the titles variable.

Cheers,

Steven Rostedt


Vladimir Tsichevski wrote:

> >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+ <gtk-list.gnome.org>
> >
> >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_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tmp),
> >GTK_POLICY_AUTOMATIC,
> >GTK_POLICY_AUTOMATIC);
> >gtk_widget_set_usize(tmp, 1, 100);
> >gtk_box_pack_start(GTK_BOX(vbox2), tmp, TRUE, TRUE, 0);
> >gtk_widget_show(tmp);
> >
> >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_widget_show(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
> >Homepage: http://www.nmt.edu/~shippy
> >
> >
> >_______________________________________________
> >gtk-list mailing list
> >gtk-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gtk-list
> >
>
> 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)
>     return;
>   if (column < 0 || column >= clist->columns)
>     return;
>
> Regards,
> 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.
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
begin:vcard 
n:Rostedt;Steven
tel;fax:607-751-6025
tel;work:607-751-5657
x-mozilla-html:FALSE
org:Lockheed Martin Systems Integration;Advanced Technologies
version:2.1
email;internet:steven rostedt lmco com
title:Staff Programmer
adr;quoted-printable:;;Mail Drop 0210=0D=0A1801 State Route 17C;Owego;NY;13827;
x-mozilla-cpt:;28512
fn:Steven Rostedt
end:vcard


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