[Pygui] to get specified lines of text

Bqsj Sjbq bqsjhaha at yahoo.com
Tue Feb 12 13:24:03 CET 2013


here is my code:

from gi.repository import Gtk
class LabelWindow(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title="Label Example")
        hbox = Gtk.Box(spacing=0)
        label = Gtk.Label("This is an example of a line-wrapped label.  It "
                          "should not be taking up the entire             "
                          "width allocated to it, but automatically "
                          "wraps the words to fit.\n"
                          "     It supports multiple paragraphs correctly, "
                          "and  correctly   adds "
                          "many          extra  spaces. ")
        label.set_line_wrap(True)
        hbox.pack_start(label, True, True, 0)
        self.add(hbox)
window = LabelWindow()        
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main()

i get the gui (attachment  line1.png),what i want to get is that gui (attachment line2.png).how can i do?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pygui/attachments/20130212/d45f0b93/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line1.png
Type: image/png
Size: 17168 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pygui/attachments/20130212/d45f0b93/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line2.png
Type: image/png
Size: 59929 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pygui/attachments/20130212/d45f0b93/attachment-0003.png>


More information about the Pygui mailing list