[pygtk] Checkbutton alignment

Joaquim Rocha joaquimrocha1 at gmail.com
Mon Apr 21 21:31:23 WST 2008


Hi all,

I got a checkbutton with a large label which is being wrapped into a few
lines.
Due to the height of the label, the checkbutton aligns vertically ending up
set on the center of its space.

Is there a way I can set the vertical alignment of the checkbutton so it
remains in the top of its space if its label is too big (has many lines)?

Here's an example.
As you can see when you run the code, the checkbutton stays aligned
vertically to the center of its space.
Can anyone help? thanks

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk

class Base:

def __init__(self):

self.window =3D gtk.Window(gtk.WINDOW_TOPLEVEL)

self.window.show()

self.checkbox =3D
gtk.CheckButton("lalalaaskjansnajksansjkasnjkansajksnajksnajnsajkns
jkasna\najnsajksnaksnanjksajksnas\njkabnsjkansjkan as\najibsajksa")

self.window.add(self.checkbox)

self.checkbox.show()

def main(self):

gtk.main()


if __name__ =3D=3D "__main__":

base =3D Base()

base.main()


Screenshots:
Here's what I got:
http://neei.uevora.pt/~jay/ssGTKProblem/ss.png

Here's what I want (GIMP helped me on this):
http://neei.uevora.pt/~jay/ssGTKProblem/ss1.png


Thank you in advance,

Joaquim Rocha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080421/df1cd2d7/at=
tachment.html


More information about the pygtk mailing list