CList column titles

Hash: SHA1


  Yet again I need some help <G>. I've got a clist with 3 columns (track
#, name, length). When the user resizes the window I want the middle
column to resize, leaving the other two (track # and length) at the width
last set by the user. This allows the user to just resize the window to
thow more of a long track name, instead of resizing the window and then
resizing the track name column.

  I actually have this almost working. I've implemented this by catching
the size_allocate signal on the window that contains the CList, and then
resizing the titles using the following code:

void resize_titles( GtkObject  *clist )
  int total_width,

  /* Get the widths of the other column titles */
  col_width = GTK_CLIST(clist)->column[0].width +

  /* This almost gives the right width, but not quite...
     The 8 is a kludge to make it look right, if you have a better
     solution, email me!
  total_width = GTK_CLIST(clist)->column_title_area.width -
                GTK_CLIST(clist)->vscrollbar->allocation.width -

  /* The questions here are:
     x 1. How do I pass clist to this routine?
     x 2. How do I get the width of the clist?
       3. How do I get the width of each of the column titles, in case
          they have been changed by the user?
          Look at the list I guess

  gtk_clist_set_column_width (GTK_CLIST (clist), 1,

The problem is that the right side of the length column doesn't line up
with the edge of the CList window. It seems to be lining up with the edge
of the scroll bar? So, is there a better way to do this?

Also, how can I catch when a user changes the width of a column and record
that change so it can be used when resizing or stored for the next time
the window is opened?



- ---------------------------------------------------------------------------
Nexus Computing                      
Software & Electronics for Linux                
Inside is a comfortable 73.71 F and Outside is a freezing 36.40 F

Version: GnuPG v0.9.0 (GNU/Linux)
Comment: Remember Lexington Green!


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