Images in GTKmm



I want to put an image into a box in such a way that the image will shrink to fit into empty space in the box, whilst preserving its aspect ratio. Thus, the dimensions of the image should be determined by the dimensions of the objects around it. The image needs to shrink and expand with the box (e.g. if the user re-sizes the main window).

For example, I want to put a few items in a VBox and have these items determine the width of the VBox. I then want to be able to add the image to the VBox in such a way that it doesn't resize the box, but rather fits into the space. If there is space left above/below the widget (due to the constraint of preserving it's aspect ratio), this should be filled with padding, rather than the image expanding to fill the space.

What's the best way of accomplishing this in Gtkmm?

Tom


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