forked from AuroraMiddleware/gtk
gtk/tests/treeview-scrolling.c: Use accessor functions to acccess GtkWidget
This commit is contained in:
parent
b1924555df
commit
6f74ff20a2
@ -416,6 +416,7 @@ test_position (GtkTreeView *tree_view,
|
|||||||
/* This is only tested for during test_single() */
|
/* This is only tested for during test_single() */
|
||||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
|
||||||
if (gtk_tree_model_iter_n_children (model, NULL) == 1) {
|
if (gtk_tree_model_iter_n_children (model, NULL) == 1) {
|
||||||
|
GtkAllocation allocation;
|
||||||
GtkTreePath *tmppath;
|
GtkTreePath *tmppath;
|
||||||
|
|
||||||
/* Test nothing is dangling at the bottom; read
|
/* Test nothing is dangling at the bottom; read
|
||||||
@ -423,7 +424,8 @@ test_position (GtkTreeView *tree_view,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIXME: hardcoded width */
|
/* FIXME: hardcoded width */
|
||||||
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (tree_view), 0, GTK_WIDGET (tree_view)->allocation.height - 30, &tmppath, NULL, NULL, NULL)) {
|
gtk_widget_get_allocation (GTK_WIDGET (tree_view), &allocation);
|
||||||
|
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (tree_view), 0, allocation.height - 30, &tmppath, NULL, NULL, NULL)) {
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
gtk_tree_path_free (tmppath);
|
gtk_tree_path_free (tmppath);
|
||||||
}
|
}
|
||||||
@ -715,6 +717,7 @@ test_editable_position (GtkWidget *tree_view,
|
|||||||
GtkWidget *editable,
|
GtkWidget *editable,
|
||||||
GtkTreePath *cursor_path)
|
GtkTreePath *cursor_path)
|
||||||
{
|
{
|
||||||
|
GtkAllocation allocation;
|
||||||
GdkRectangle rect;
|
GdkRectangle rect;
|
||||||
GtkAdjustment *vadj;
|
GtkAdjustment *vadj;
|
||||||
|
|
||||||
@ -724,7 +727,8 @@ test_editable_position (GtkWidget *tree_view,
|
|||||||
vadj = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (tree_view));
|
vadj = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (tree_view));
|
||||||
|
|
||||||
/* There are all in bin_window coordinates */
|
/* There are all in bin_window coordinates */
|
||||||
g_assert (editable->allocation.y == rect.y + ((rect.height - editable->allocation.height) / 2));
|
gtk_widget_get_allocation (editable, &allocation);
|
||||||
|
g_assert (allocation.y == rect.y + ((rect.height - allocation.height) / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user