Re: [gtk-list] Re: scrolled image



On Mon, 17 Apr 2000 11:28:29 +0200, alfio castorina said:

>  I simple want to open the image and display the window without
scrollbars
>  (if the image fits into the screen), letting then scrollbars appear
when
>  the
>  user resizes the window making it smaller then the image size.
>  I think its the standard behaviour of every image displayer.
>  Maybe, when i first open the image i could add some pixel displacement
>  taking into account the size of the scrollbars. But even if this would
be
>  possibile , i think the results could be different depending on the
>  window
>  manager and the themes used.
>  
>  Thank you for your interest.

Herm... what you want is to pack your image into a Gtk::ScrolledWindow
and set the policy to ('automatic','automatic')

Then pack the ScrolledWindow into your main window.

Use a function to calculate the size of your image... set the usize on
the main window to be that size, and you should have no scrollbars... but
if the user resizes, the scrollbars will appear.  You MAY need to set the
window size slightly (1 or 2 pixels) larger than the image size to
compensate for the window borders, I am not certain, but this is a fairly
simple thing to play with and figure out.

-Steve



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