GNOME Bugzilla – Bug 741394
GocCanvas as child of GtkScrolledWindow doesn't implement proper scrolling
Last modified: 2015-01-07 14:43:18 UTC
Created attachment 292532 [details] GocItems overlap but scrolledwindow doesn't respond accordingly Dear developers,
Dear developers, i added a GocCanvas instance to a GtkScrolledWindow. After drawing on the canvas the scrolled window doesn't respond correctly by showing the proper scrollbars. Unfortunately if the size of the corresponding GtkWindow is reduced some items on the canvas are inaccessible (you see that in the attached file). Considering that GocCanvas implements GtkScrollable this seems to be a major bug. Best regards
The widget size and the canvas size are two different things for GocCanvas. A Gtk+ widget use integers for its size, but this is not large enough for gnumeric (in some rare cases though) unless the integers are 64 bits integers. You need to change the widget requisition after each canvas modification.
Thank you for your fast response. Since i'm very new to goffice it's however somewhat diffuse to me. For instance, if i adjust the size of the layout with gtk_layout_set_size(GTK_LAYOUT(canvas)), width, height); and width and height are big enough scrollbars appear. Unfortunately if i scroll that doesn't result in scrolling the content of the canvas. Or have i just taken the references to seriously with respect to the implementation of the GtkScrollable interface. Which means that i have to adapt the GocCanvas to the scrolled window by hand i.e. subclassing it and take a look into the details? By saying that you can maybe tell me how other applications manage that?
OK, I was not clear enough. GocCanvas does not really implements GtkScrollable (it is only implemented through GtkLayout). I would say it should scroll when the GtkLayout is large enough, but apparently it does not, which I find quite weird. In gnumeric, we don't use a scrolled window. We just use two scrollbars and use goc_canvas_scroll_to() to show the correct region.
Thank you for your response. Especially the second paragraph makes sense. I will try to do it this way. Maybe you can tell me where the exact location inside the gnumeric code where the scrolling mechanism takes place? Thanks in advance
The code is in sheet-control-gui.c. The functions are gnm_pane_set_top_left() (line 870) and friends.
Thanks a lot I will look into it..
Anyway, this might be easily fixed.
Created attachment 293843 [details] [review] patch This would fix the bug if needed.