[pygtk] Center aligning a wrapped gtk.label under a gtk.Image object

Anish Mangal anishmangal2002 at gmail.com
Fri Jul 23 14:05:18 WST 2010


Hi,

Can someone help me with this? Seems pretty trivial but I can't seem
to get it right. Thanks!

--
Anish Mangal
anish at sugarlabs.org

On Fri, Jul 2, 2010 at 2:26 PM, Anish Mangal <anishmangal2002 at gmail.com> wrote:
> Hi,
>
> I'm trying to center align gtk.label object under a gtk.Image object
> by putting them both in a vbox and calling the set_alignment, and
> set_justify tasks wherever needed. When I set the label wrapping to
> OFF, the label gets perfectly center aligned under the text. However,
> I'm restricted to have label wrapping ON since the parent vbox needs
> to have a fixed horizontal dimension. So when I turn wrapping on, the
> label gets left aligned instead of being center aligned.
>
> I've sought for help on this on #pygtk with little success so far. Any
> help would be appreciated.
>
> Here is the pygtk code that demonstrates the issue.
> http://people.sugarlabs.org/~anish/table-image-label-center-test.py
>
> One can comment out the set_wrap lines and see that the label gets
> center aligned under the text.
>
> --
> Anish Mangal
> anish at sugarlabs.org
>


More information about the pygtk mailing list