Ethereal-dev: Re: [ethereal-dev] Added col_append_str

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: guy@xxxxxxxxxx (Guy Harris)
Date: Mon, 12 Apr 1999 19:36:01 -0700 (PDT)
> With respect to my suggestions around dissect_telnet and dissect_ftp, I
> added col_append_str and it seems to work. One problem is that the rest of
> the line does not display unless you expand the column and then scroll.
> 
> Is there any way to have that column as wide as the widest text in it by
> default?

If "gtk_clist_set_column_width()" causes columns to expand in width (and
causes the top-level window to expand as needed), then having
"col_add_str()", "col_append_str()", etc. keep track of the maximum
width of the column to which they're adding stuff, and using that to
change the column widths after all packets have been run through the
dissector to generate their summary lines,t hat might do it.  (See the
"XXX" comment before "get_column_width()".)

> I would have added col_append_fstr, but could not come to grips with how to
> have vsnprintf add additional items to its list, like the current contents
> of the column :-)

One could, I guess, copy "fd->cinfo->col_data[i]" to a temporary buffer,
and append it after the "vsnprintf()" call.