Bug 9194

Summary: hildon_pannable_area_scroll_to example is wrong (pointer instead of struct)
Product: [Maemo Official Platform] Desktop platform Reporter: Thomas Perl <m>
Component: hildon-widgetsAssignee: Claudio Saavedra <csaavedra>
Status: RESOLVED FIXED QA Contact: hildon-libs-bugs
Severity: normal    
Priority: Unspecified CC: agarcia, andre_klapper
Version: 5.0/(2.2009.51-1)Keywords: docs
Target Milestone: 5.0/(10.2010.19-1)   
Hardware: All   
OS: Maemo   
URL: http://maemo.org/api_refs/5.0/5.0-final/hildon/HildonPannableArea.html

Description Thomas Perl (reporter) 2010-02-21 16:29:34 UTC
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
Comment 1 Thomas Perl (reporter) 2010-02-21 16:30:10 UTC
Also, the local variable "y" is not declared in the example.
Comment 2 Alberto Garcia Gonzalez 2010-02-22 16:22:46 UTC
Fixed, thanks!

http://maemo.gitorious.org/hildon/hildon/commit/4f589e3dce4f72ef8809ef030764602707acc8f0
Comment 3 Andre Klapper maemo.org 2010-03-15 20:54:30 UTC
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).