GNOME Bugzilla – Bug 118498
ScrolledWindow doesn't scroll DrawingArea
Last modified: 2004-12-22 21:47:04 UTC
I hope I'm just missing an event handler, but I have not been able to create a ScrolledWindow that allows scrolling. I'm trying to create a ScrolledWindow that is initially centered on a DrawingArea of unknown size (i.e. may be larger or smaller than the ScrolledWindow). However, the scrollbars won't allow me to scroll, despite the fact that the accessors for the associated Adjustments seem to indicate that their entire range is not currently visible within one page size. If I set the ScrolledWindow policy to POLICY_AUTOMATIC, the scrollbars do not appear, but the entire Pixbuf is clearly not visible at once. I am attaching a simple test case that displays my problem. As stated, I believe that I could simply be missing an event handler, but this code is directly converted from gtk+ C code that does work (I can submit that upon request). A ScrolledWindow example in the documentation might help me fix this problem ;)
Created attachment 18687 [details] test case: broken ScrolledWindow containing DrawingArea
> but this code is directly converted from gtk+ C code that does work (I > can submit that upon request) Yes, please. That is often very helpful.
Created attachment 18724 [details] The C (gtk+) version, which *does* scroll.
After reducing the examples some more (which you really could have done yourself), I find that the C++ version has no equivalent for the gtk_drawing_area_size() call. gtk_drawing_area_size() is deprecated: http://developer.gnome.org/doc/API/2.0/gtk/GtkDrawingArea.html#gtk-drawing-area-size So you should probably call set_size_request() on the DrawingArea. I would try it but I have just killed my hard drive.