(C language, GTK library)
On my form, I have a GtkDrawingArea widget on which I draw GdkPixbufs (loaded from files) with Cairo. What I’d like to accomplish is to be able to scroll the drawing area with scrollbars while window size remains fixed (the image drawn is larger than the window). How can I do that? Putting GtkDrawingArea in ScrolledWindow container didn’t work (or maybe I have done something wrong – I’m new to GTK).
The simpler solution the better.
Cheers!
Some widgets don’t have scrolling capability.
GtkDrawingAreais one of them. You can adapt these widgets by putting them first inside aGtkViewportthen into aGtkScrolledWindowIn versions before GTK 3.8gtk_scrolled_window_add_with_viewportis a convenience method to do this.In later versions it is done automatically by
gtk_container_add.