keep the channel list uptodate on position changes. unref list items on

Fri May  1 13:22:21 1998  Tim Janik  <timj@gtk.org>

        * app/channels_dialog.c: keep the channel list uptodate
        on position changes. unref list items on destruction.

        the app/channels_dialog.c app/layers_dialog.c code for dealing
        with GtkList is a MESS, it needs to be completely reworked
        somewhen. this is *no* fun: the selection is changed so update
        the list (causing the selection to change again: the selection
        is changed so update the list (causing the selection to change
        again: the selection is changed so update the list (.... oops,
        sorry got caught in a recursive loop there ;) ))).
This commit is contained in:
Tim Janik 1998-05-01 13:18:28 +00:00 committed by Tim Janik
parent 0e0976de94
commit 9a1914e355
5 changed files with 27 additions and 10 deletions

View File

@ -1,3 +1,16 @@
Fri May 1 13:22:21 1998 Tim Janik <timj@gtk.org>
* app/channels_dialog.c: keep the channel list uptodate
on position changes. unref list items on destruction.
the app/channels_dialog.c app/layers_dialog.c code for dealing
with GtkList is a MESS, it needs to be completely reworked
somewhen. this is *no* fun: the selection is changed so update
the list (causing the selection to change again: the selection
is changed so update the list (causing the selection to change
again: the selection is changed so update the list (.... oops,
sorry got caught in a recursive loop there ;) ))).
Thu Apr 30 16:49:41 PDT 1998 Manish Singh <yosh@gimp.org>
* app/channels_dialog.c: fix for off-by-one error in channel

View File

@ -690,12 +690,13 @@ channels_dialog_position_channel (ChannelWidget *channel_widget,
/* Remove the channel from the dialog */
list = g_list_append (list, channel_widget->list_item);
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
suspend_gimage_notify--;
/* Add it back at the proper index */
gtk_list_insert_items (GTK_LIST (channelsD->channel_list), list, new_index + channelsD->num_components);
channelsD->channel_widgets = g_slist_insert (channelsD->channel_widgets, channel_widget, new_index + channelsD->num_components);
}
@ -1070,7 +1071,7 @@ create_channel_widget (GImage *gimage,
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (GTK_WIDGET (channel_widget->list_item));
gtk_widget_ref (channel_widget->list_item);
return channel_widget;
}
@ -1085,7 +1086,7 @@ channel_widget_delete (ChannelWidget *channel_widget)
/* Remove the channel widget from the list */
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
/* Free the widget */
/* Release the widget */
gtk_widget_unref (channel_widget->list_item);
g_free (channel_widget);
}

View File

@ -690,12 +690,13 @@ channels_dialog_position_channel (ChannelWidget *channel_widget,
/* Remove the channel from the dialog */
list = g_list_append (list, channel_widget->list_item);
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
suspend_gimage_notify--;
/* Add it back at the proper index */
gtk_list_insert_items (GTK_LIST (channelsD->channel_list), list, new_index + channelsD->num_components);
channelsD->channel_widgets = g_slist_insert (channelsD->channel_widgets, channel_widget, new_index + channelsD->num_components);
}
@ -1070,7 +1071,7 @@ create_channel_widget (GImage *gimage,
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (GTK_WIDGET (channel_widget->list_item));
gtk_widget_ref (channel_widget->list_item);
return channel_widget;
}
@ -1085,7 +1086,7 @@ channel_widget_delete (ChannelWidget *channel_widget)
/* Remove the channel widget from the list */
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
/* Free the widget */
/* Release the widget */
gtk_widget_unref (channel_widget->list_item);
g_free (channel_widget);
}

View File

@ -531,6 +531,7 @@ layers_dialog_flush ()
{
lw = (LayerWidget *) list->data;
list = g_slist_next (list);
if ((gimage_pos = gimage_get_layer_index (gimage, lw->layer)) != pos)
layers_dialog_position_layer ((lw->layer), gimage_pos);
@ -2034,7 +2035,7 @@ layer_widget_delete (LayerWidget *layer_widget)
/* Remove the layer widget from the list */
layersD->layer_widgets = g_slist_remove (layersD->layer_widgets, layer_widget);
/* Free the widget */
/* Release the widget */
gtk_widget_unref (layer_widget->list_item);
g_free (layer_widget);
}

View File

@ -531,6 +531,7 @@ layers_dialog_flush ()
{
lw = (LayerWidget *) list->data;
list = g_slist_next (list);
if ((gimage_pos = gimage_get_layer_index (gimage, lw->layer)) != pos)
layers_dialog_position_layer ((lw->layer), gimage_pos);
@ -2034,7 +2035,7 @@ layer_widget_delete (LayerWidget *layer_widget)
/* Remove the layer widget from the list */
layersD->layer_widgets = g_slist_remove (layersD->layer_widgets, layer_widget);
/* Free the widget */
/* Release the widget */
gtk_widget_unref (layer_widget->list_item);
g_free (layer_widget);
}