Re: Invisible GtkImage



On Fri, 2013-06-14 at 18:17 -0700, Andrew Potter wrote:
That's unusual. Quick testing of my own image resizing does not seem
to have that occur. If you're sure that your requests are always
absolutely sane, you might want to put together a small test case as
it could indicate a pygtk bug, or maybe a gtk+ bug.

It could be a bug, but in my experience, it's probably the developer's
fault (me). But I'll try to look into it further if I get a chance. In
the mean time, I'll have to be content with...

        if allocation.width <= 0 or allocation.height <= 0:
                return

Is your TextView set to have a minimum height?

So the bad news is I tried setting a minimum height for the TextView
and no love. But the good news is I changed the
do_get_preferred_height_for_width() override to return a value of 1 for
the minimum_height...

        def do_get_preferred_height_for_width(self, width):

                height = width / self._aspectRatio
                
                # Return the minimum height and natural height...
                return 1, height

I'm still not sure what exactly the minimum_height is for, or if leaving
it at 1 is going to be a problem, but the clipping issue seems fine and
the image rescales _almost_ fine now.

If I advance the assistant page to the next one, however, the image is
no longer scaled uniformly, but is squished at only half the height it
was while maintaining the same width.

I suspect it has more to do with Python's dynamic typing. But you
might raise the issue with the pygtk folks [1].

Done. Thanks.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


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