Re: GtkCLists: Swapping columns and popup menus




On Tue, 10 Oct 2000, Ken Steen wrote:

   1. I would like to make it possible for the user to click-and-drag a
     column in a CList, making it simple to rearrange the columns.  There
     is a function for swapping rows (which is obviously simple since each
     row is itself a discrete object), but none for swapping columns.  It
     seems that I will likely have to write a routine that loops through
     the rows and swaps the contents row-by-row, as well as swapping the
     title widgets.  The question is, how do I determine which column is
     to be swapped with which?  Is there some sort of routine available
     that will handle most of the grunt work for me?  Just something that
     will keep track of the beginning of the drag-and-drop and tell me
     which column I should be moving, and to where...
The only way that I know of to do this is to keep track of your clist
columns and recreate the clist with the columns in a new order.  When
you initially create the clist use a list of columns with the default
order.  The drag and drop would just change the order of the list of
columns and then call a function to recreate the clist.

   Yes, I'd already settled on this method for handling the updating
of the CList.  My problem is how to inform that routine of what changes
need to be made.  How do I go from the mouse click/drag to a callback
that actually will inform said routine that column "7" has been moved
to column "3" (e.g.) so that it can *do* the redraw?

[Good answer to question 2 snipped -- thanks!]

best,
Jim Wiggs
wiggs wiggs net





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