Checkbutton alignment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jayro
    New Member
    • Jul 2007
    • 6

    Checkbutton alignment

    Hi folks,

    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)?


    Thanks in advance,

    Jay
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    Can you tell us what package you're using? (ie, wxPython, Tkinter, etc...)
    Also a very concise example would help us to see what it is that you're having trouble with.

    Comment

    • jayro
      New Member
      • Jul 2007
      • 6

      #3
      Hi,

      oops, sorry.. I forgot to say which toolkit I am using.

      It is pyGTK.

      Thanks,

      Comment

      • jayro
        New Member
        • Jul 2007
        • 6

        #4
        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 = gtk.Window(gtk. WINDOW_TOPLEVEL )
        self.window.sho w()
        self.checkbox = gtk.CheckButton ("lalalaaskjans najksansjkasnjk ansajksnajksnaj nsajknsjkasna\n ajnsajksnaksnan jksajksnas\njka bnsjkansjkanas\ najibsajksa")
        self.window.add (self.checkbox)
        self.checkbox.s how()
        def main(self):
        gtk.main()

        if __name__ == "__main__":
        base = Base()
        base.main()

        Screenshots:
        Here's what I got:


        Here's what I want (GIMP helped me on this):

        Comment

        Working...