> We may want to arrange that, if you try to open an Edit box for a filter
> for which we already have an Edit box, we just call the GTK+ function to
> raise the existing Edit box (or, to be pedantic, to request that the
> window manager raise the existing Edit box).
The colorization stuff needs some cleanup, so that it can do that, can
kill off any open Edit boxes if the filter to which it refers is
deleted, can support having multiple Edit boxes open on different
filters, etc..
Here's some initial thoughts on how to do it:
Add strings for the name and filter string, and a GtkWidget pointer for
the edit box, to the "color_filter_t" structure.
Have a list of those structures, which represents the current list of
color filters.
Have the GtkCList merely act to display that data - don't keep it around
if there's no "Add colors to protocol" dialog box open. Have its row
data still be the "color_filter_t" pointer.
"read_filters()" and "write_filters()" read into the list of
"color_filter_t" structures, and write to the file from that list,
rather than getting stuff from the GtkCList.
The Edit box has the "color_filter_t" structure associated with it as
data, as well as any color selection dialogs.
In the "Add color to protocols" dialog:
"New" creates an edit box and associates it with the filter.
"Edit" just raises the edit box if there already is one,
otherwise it creates one and associates it with the filter.
"Delete" kills the edit box, if any, for the window, and its
color selection dialogs.
"OK" and "Cancel" kill any edit boxes open.
In the edit box:
"Choose foreground color" and "Choose background color" pop up a
color selection box and associate it with the edit box.
"OK" and "Cancel" kill any color selection boxes associated with
the edit box.
(There are other places where we should handle raising dialog boxes
rather than popping up new ones, e.g. the "Display:Colorize Display"
menu item itself, and several other menu items where it doesn't make
sense to have more than one dialog box open for the function.)
I'll look into doing this, time permitting.