Viewport out of control (most probably a layout question)



Hello everybody,

I must admit that I'm a gtk noob (just started to use it yesterday) but I couldn't figure it out by myself...

I try to achieve the following:
I want to display a smaller part of a bigger image in a window alongside with some buttons. The image part should NOT have scrollbars but be scrollable in a grab-n-drag like fashion (like with the grab cursor in photoshop). My initial solution was to load the image as a gtk_image and put it into a gtk_viewport then catch any clicks on the viewport and adjust its gtk_adjustments accordingly. That scrolling kind of worked BUT... the viewport always resizes itself initially to be as big as the whole image - blowing my app's layout and extending well beyond my app's window. It works as expected with a gtk_scrolled_window but that shows the scrollbars I try to avoid. If I set the policy to show no scrollbars the problem returns - a huuuge viewport out of control.

I tried to pack the viewport/scrolled_window together with the buttons into hboxes or vboxes or tables... same result.
I am afraid I may not have understood the gtk layout system, yet... :-?

Thanks for your help!

        Thorsten




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]