I am new to GTK but have done some programming in python.  I am having 
difficulty getting widgets to be vertically aligned.  I have a 2x2 GtkTable 
and would like the 2 'GtkLabel's on the left side of the table to have their 
rightmost portion of the text to be adjacent to the boundary of the cell 
they're in.  I would also like the 2 'GtkEntry's on the right side of the 
table to have leftmost portion adjacent to the boundary of the cell they're 
in.

This seems to work as long as the 2 labels have the same horizontal size and 
the 2 text entrys also have the same horizontal size.  But if one is smaller, 
the smaller one is not drawn adjacent to the cell boundary.  Is there a way I 
can get what I want?

Thanks for any help you can give.  I using:
gtk+-1.2.9-4
pygtk-0.6.6-7 and
python-1.5.2-30
on a Redhat 7.1 system.

Gary

The script I'm using is as follows.

---------------------------------------------------------
#!/usr/bin/env python

import gtk

def delete_event(widget, event, data=None):
        return gtk.FALSE

def destroy(widget, data=None):
        gtk.mainquit()

win = gtk.new(gtk.GtkWindow,
        type=gtk.WINDOW_TOPLEVEL,
        title="Test Win",
        allow_grow=gtk.FALSE,
        allow_shrink=gtk.FALSE,
        border_width=20)

win.connect("destroy", destroy)

tabl = gtk.GtkTable(2, 2, gtk.FALSE)
win.add(tabl)

lab00 = gtk.GtkLabel("-----Longer Label-----")
lab00.set_justify(gtk.JUSTIFY_RIGHT)
tabl.attach(lab00, 1, 2, 0, 1, 0, 0, 0, 0)

text01 = gtk.GtkEntry()
text01.set_usize(50, -1)
tabl.attach(text01, 2, 3, 0, 1, 0, 0, 0, 0)

lab10 = gtk.GtkLabel("Shorter Label")
lab10.set_justify(gtk.JUSTIFY_RIGHT)
tabl.attach(lab10, 1, 2, 1, 2, 0, 0, 0, 0)

text02 = gtk.GtkEntry()
text02.set_usize(100, -1)
tabl.attach(text02, 2, 3, 1, 2, 0, 0, 0, 0)

win.show_all()
gtk.mainloop()
-------------------------------------------------------


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to