maemo.org Bugzilla – Bug 9194
hildon_pannable_area_scroll_to example is wrong (pointer instead of struct)
Last modified: 2010-03-15 20:54:30 UTC
You need to log in before you can comment on or make changes to this bug.
SOFTWARE VERSION: today's documentation on the web server EXACT STEPS LEADING TO PROBLEM: 1. Read the example code for hildon_pannable_area_scroll_to ("example 11") EXPECTED OUTCOME: GtkTreePath *path; GdkRectangle rect; path = gtk_tree_model_get_path (model, &iter); gtk_tree_view_get_background_area (GTK_TREE_VIEW (treeview), path, NULL, &rect); gtk_tree_view_convert_bin_window_to_tree_coords (GTK_TREE_VIEW (treeview), 0, rect.y, NULL, &y); hildon_pannable_area_scroll_to (panarea, -1, y); gtk_tree_path_free (path); ACTUAL OUTCOME: GtkTreePath *path; GdkRectangle *rect; path = gtk_tree_model_get_path (model, &iter); gtk_tree_view_get_background_area (GTK_TREE_VIEW (treeview), path, NULL, &rect); gtk_tree_view_convert_bin_window_to_tree_coords (GTK_TREE_VIEW (treeview), 0, rect.y, NULL, &y); hildon_pannable_area_scroll_to (panarea, -1, y); gtk_tree_path_free (path); REPRODUCIBILITY: always OTHER COMMENTS: The "GdkRectangle" is a struct that has to be filled by gtk_tree_view_get_background_area, not a pointer to that struct. The example does not work in the documentation, because this would give a "GdkRectangle**" to the gtk_tree_view_get_background_area() function. See the documentation for gtk_tree_view_get_background_area at: http://library.gnome.org/devel/gtk/unstable/GtkTreeView.html#gtk-tree-view-get-background-area
Also, the local variable "y" is not declared in the example.
Fixed, thanks! http://maemo.gitorious.org/hildon/hildon/commit/4f589e3dce4f72ef8809ef030764602707acc8f0
Setting explicit PR1.2 milestone (so it's clearer in which public release the fix will be available to users). Sorry for the bugmail noise (you can filter on this message).