Try setting the "expand" and "fill" properties when you pack the label into a dialog:
diag.vbox.pack_start(lbl, True, True, 0)
Edit
You're right. I'm sorry. In the GTK Reference Guide:
Please note that setting line feed to TRUE does not make the wrapper of the label in its parent container wide, since GTK + concepts cannot conceptually make their application dependent on the size of the parent container. For a label that wraps at a specific position, set the label width using gtk_widget_set_size_request ().
Therefore, set the size request in GtkLabel instead of GtkDialog , and then in the dialog box and give the size of the dialog yourself.
# -*- coding: utf-8 -*- import gtk if __name__ == "__main__": lbl = gtk.Label('Presione el botón "Adelante" para iniciar la instalación del sistema. Después de este paso no podrá detener la instalación, así que asegúrese de que sus datos son correctos.') lbl.set_line_wrap(True) lbl.set_alignment(0, 0.5) lbl.set_justify(gtk.JUSTIFY_FILL) lbl.set_size_request(640, 480) lbl.show() diag = gtk.Dialog() diag.set_resizable(True) diag.vbox.pack_start(lbl, True, True, 0) diag.run()
source share