Commit c4c1c1ea authored by Tim Janik's avatar Tim Janik
Browse files

more fixups -timj

more fixups
-timj
parent 6d3ef70d
......@@ -2,12 +2,10 @@ TODO BEFORE GTK 1.0
-------------------
Bugs:
* gtk_list_clear_items: free start_list
* GtkComboBox: need to destroy gdk cursor
* Vertical scrollbar: the expose event looks hosed and is causing
quite a bit of flickering
Actually this affects both scrollbar implementation, you can best
tell if you run the application with --sync (timj)
* signal parameters don't seem to get refreshed on recursive invokations
of GTK_NO_RECURSE signals, which causes the restarted emissions to loose
......
......@@ -375,11 +375,17 @@ gtk_hscrollbar_trough_keys(GtkRange *range,
break;
case GDK_Home:
return_val = TRUE;
*pos = GTK_TROUGH_START;
if (key->state & GDK_CONTROL_MASK)
*scroll = GTK_SCROLL_PAGE_BACKWARD;
else
*pos = GTK_TROUGH_START;
break;
case GDK_End:
return_val = TRUE;
*pos = GTK_TROUGH_END;
if (key->state & GDK_CONTROL_MASK)
*scroll = GTK_SCROLL_PAGE_FORWARD;
else
*pos = GTK_TROUGH_END;
break;
}
return return_val;
......
......@@ -411,13 +411,14 @@ gtk_list_clear_items (GtkList *list,
if ((end < 0) || (end > nchildren))
end = nchildren;
g_return_if_fail (start < end);
if (start >= end)
return;
start_list = g_list_nth (list->children, start);
end_list = g_list_nth (list->children, end);
if (start_list->prev)
start_list->prev->next = end_list;
start_list->prev->next = end_list;
if (end_list && end_list->prev)
end_list->prev->next = NULL;
if (end_list)
......@@ -441,17 +442,16 @@ gtk_list_clear_items (GtkList *list,
gtk_widget_unref (widget);
}
/* list->children = g_list_remove (list->children, widget); */
/* gtk_widget_unparent (widget); */
gtk_widget_unparent (widget);
}
g_list_free (start_list);
if (list->children && !list->selection &&
(list->selection_mode == GTK_SELECTION_BROWSE))
{
gtk_list_select_child (list, widget);
widget = list->children->data;
gtk_list_select_child (list, widget);
}
if (selection_changed)
......
......@@ -375,7 +375,7 @@ gtk_range_default_vslider_update (GtkRange *range)
else if (y > bottom)
y = bottom;
gdk_window_move (range->slider, GTK_WIDGET (range)->style->klass->ythickness, y);
gdk_window_move (range->slider, GTK_WIDGET (range)->style->klass->xthickness, y);
}
}
......@@ -1362,7 +1362,7 @@ gtk_range_trough_vdims (GtkRange *range,
gdk_window_get_size (range->trough, NULL, &trough_height);
gdk_window_get_size (range->slider, NULL, &slider_length);
ttop = GTK_WIDGET (range)->style->klass->xthickness;
ttop = GTK_WIDGET (range)->style->klass->ythickness;
tbottom = trough_height - slider_length - GTK_WIDGET (range)->style->klass->ythickness;
if (range->step_back)
......
......@@ -1873,6 +1873,13 @@ list_remove (GtkWidget *widget,
g_list_free (clear_list);
}
static void
list_clear (GtkWidget *widget,
GtkWidget *list)
{
gtk_list_clear_items (GTK_LIST (list), 3 - 1, 5 - 1);
}
static void
create_list ()
{
......@@ -1955,6 +1962,14 @@ create_list ()
gtk_box_pack_start (GTK_BOX (box2), button, FALSE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("clear items 3 - 5");
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_clear),
list);
gtk_box_pack_start (GTK_BOX (box2), button, FALSE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("remove");
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
......
......@@ -1873,6 +1873,13 @@ list_remove (GtkWidget *widget,
g_list_free (clear_list);
}
static void
list_clear (GtkWidget *widget,
GtkWidget *list)
{
gtk_list_clear_items (GTK_LIST (list), 3 - 1, 5 - 1);
}
static void
create_list ()
{
......@@ -1955,6 +1962,14 @@ create_list ()
gtk_box_pack_start (GTK_BOX (box2), button, FALSE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("clear items 3 - 5");
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_clear),
list);
gtk_box_pack_start (GTK_BOX (box2), button, FALSE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("remove");
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
......
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