Re: Invisible GtkImage



On Sun, Jun 23, 2013 at 11:17 AM, Kip Warner <kip thevertigo com> wrote:
On Sun, 2013-06-23 at 20:11 +0200, David Nečas wrote:
Well, as it has already been suggested, this is a matter of packing. If
you request that the widget does not expand

    page.pack_start(page._bannerAspectFrame, False, False, 0)

then the containing box will not expand the widget when it is enlarged
itself.  You have to pass expand=True, fill=True.

Hey David. Like I said to Colomban already, I already tried that.

For a vertically orientated GtkBox, the 'expand' field in pack_start
is going to be vertical expansion, so you are not going to want that.
Instead set the GtkBox.set_hexpand(true) (and
GtkBox.set_halign(GTK_ALIGN_FILL)), but definitely do pack children
with Fill=True.
Make sure both the GtkAspectFrame and the GtkDrawingArea are set to
both set_halign(GTK_ALIGN_FILL) and set_valign(GTK_ALIGN_FILL).

That means the aspect frame will receive the extra width, and its
internal ratio keeping will make its implementation of
get_requested_height_for_width() request enough height for your image
to expand properly.

Its all a problem of packing with expand & fill at this point. Just
think about how you want the toolkit to work and make sure each
component in the hierarchy is doing the right thing.


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