Commit 9a1914e3 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

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 ;) ))).
parent 0e0976de
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
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment