From bqsjhaha at yahoo.com Tue Feb 12 13:24:03 2013 From: bqsjhaha at yahoo.com (Bqsj Sjbq) Date: Tue, 12 Feb 2013 04:24:03 -0800 (PST) Subject: [Pygui] to get specified lines of text Message-ID: <1360671843.77631.YahooMailNeo@web160601.mail.bf1.yahoo.com> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: line1.png Type: image/png Size: 17168 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: line2.png Type: image/png Size: 59929 bytes Desc: not available URL: From greg.ewing at canterbury.ac.nz Tue Feb 12 23:12:57 2013 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 13 Feb 2013 11:12:57 +1300 Subject: [Pygui] to get specified lines of text In-Reply-To: <1360671843.77631.YahooMailNeo@web160601.mail.bf1.yahoo.com> References: <1360671843.77631.YahooMailNeo@web160601.mail.bf1.yahoo.com> Message-ID: <511ABE69.70903@canterbury.ac.nz> Bqsj Sjbq wrote: > here is my code: > > from gi.repository import Gtk This appears to be a gtk question, not a PyGui question. This mailing list is for the PyGui toolkit in particular, not Python guis in general. You are likely to get more help if you post this to the Gtk mailing list. -- Greg From shamrin at gmail.com Thu Feb 28 16:18:31 2013 From: shamrin at gmail.com (Alexey Shamrin) Date: Thu, 28 Feb 2013 19:18:31 +0400 Subject: [Pygui] [win32] GUI.Numeric.image_from_ndarray fails for certain image sizes Message-ID: Hello! GUI.Numeric.image_from_ndarray fails for certain image sizes under Windows: >>> from numpy import zeros, uint8 >>> from GUI.Numerical import image_from_ndarray >>> image_from_ndarray(zeros((1,7,3),dtype=uint8),'RGB').size (0L, 0L) >>> image_from_ndarray(zeros((1,8,3),dtype=uint8),'RGB').size (8L, 1L) I think it's because row_stride wants to be a multiple of 4 (in GDIPlus.Bitmap.from_data): GdipCreateBitmapFromScan0(width, height, row_stride, format, data, byref(ptr)) -- Alexey