if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
clist = GTK_CLIST (ctree);
- if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
GTK_CTREE_ROW (node)->expanded = TRUE;
level = GTK_CTREE_ROW (node)->level;
clist = GTK_CLIST (ctree);
- if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
GTK_CTREE_ROW (node)->expanded = FALSE;
level = GTK_CTREE_ROW (node)->level;
}
if (ctree_row->row.destroy)
- ctree_row->row.destroy (ctree_row->row.data);
+ {
+ GtkDestroyNotify dnotify = ctree_row->row.destroy;
+ gpointer ddata = ctree_row->row.data;
+
+ ctree_row->row.destroy = NULL;
+ ctree_row->row.data = NULL;
+
+ dnotify (ddata);
+ }
g_mem_chunk_free (clist->cell_mem_chunk, ctree_row->row.cell);
g_mem_chunk_free (clist->row_mem_chunk, ctree_row);
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
gpointer data,
GtkDestroyNotify destroy)
{
+ GtkDestroyNotify dnotify;
+ gpointer ddata;
+
g_return_if_fail (ctree != NULL);
g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
+ dnotify = GTK_CTREE_ROW (node)->row.destroy;
+ ddata = GTK_CTREE_ROW (node)->row.data;
+
GTK_CTREE_ROW (node)->row.data = data;
GTK_CTREE_ROW (node)->row.destroy = destroy;
+
+ if (dnotify)
+ dnotify (ddata);
}
gpointer
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
- if (clist->anchor != -1)
- GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
+ GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
g_list_free (clist->undo_selection);
g_list_free (clist->undo_unselection);
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CTREE (clist));
- if (clist->anchor < 0)
+ if (clist->selection_mode != GTK_SELECTION_EXTENDED)
+ return;
+
+ if (clist->anchor < 0 || clist->drag_pos < 0)
return;
ctree = GTK_CTREE (clist);
case GTK_CLIST_DRAG_NONE:
break;
case GTK_CLIST_DRAG_INTO:
- g_print ("drag into\n");
if (check_drag (ctree, source_node, dest_node,
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node, dest_node,
g_dataset_remove_data (context, "gtk-clist-drag-dest");
break;
case GTK_CLIST_DRAG_BEFORE:
- g_print ("drag before\n");
if (check_drag (ctree, source_node, dest_node,
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node,
g_dataset_remove_data (context, "gtk-clist-drag-dest");
break;
case GTK_CLIST_DRAG_AFTER:
- g_print ("drag after\n");
if (check_drag (ctree, source_node, dest_node,
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node,