Re: [Iup-users] Bug with iupText, double newlines, and formatting.
Brought to you by:
scuri
From: Antonio S. <sc...@te...> - 2010-09-09 01:25:47
|
This looks like a bug. I'll take a look and return to you soon. Best, scuri From: Nicolas Noble [mailto:ni...@no...] Sent: quarta-feira, 8 de setembro de 2010 21:59 To: Iup...@li... Subject: [Iup-users] Bug with iupText, double newlines, and formatting. Hello, I'd like to report a weird bug I'm having with the iupText widget, when formatting is enabled, and the text has double end-of-lines. Here's an example that demonstrates this problem: text = iup.text { multiline = "Yes", formatting = "Yes", expand = "Yes", value = "Line1\n\nLine2\n\nLine3\n\nLine4\n\nLine5\n\n" } b = iup.button { title = "Test", action = function() text.value = text.value end } dlg = iup.dialog { size = "100x150", iup.vbox { text, iup.hbox { iup.fill{}, b, iup.fill{} } } } dlg:show() Notice how the default value has two \n between each piece of text. If you run this in LuaConsole, and press the button, you'd get the following screens: http://picasaweb.google.com/lh/photo/0JVFt7sgvsn9ZPnLSJaZXMNvd5Ms4N0Bu8PXZhD bwD0 http://picasaweb.google.com/lh/photo/mxIiyI5A0OHIsdg45W7j1sNvd5Ms4N0Bu8PXZhD bwD0 http://picasaweb.google.com/lh/photo/ddPyGwyGJEWy01oNYlUXaMNvd5Ms4N0Bu8PXZhD bwD0 http://picasaweb.google.com/lh/photo/2-2DI8s33_HnlnDdo16-yMNvd5Ms4N0Bu8PXZhD bwD0 Basically, every time we assign something to text.value, the first \n\n is being transformed to a single \n. So if you have several of them in the control, and you re-assign the same value over and over (through save'n'load for example), you'd loose one \n\n couple. I haven't been able to track this one yet into the source, but I'll try whenever I have the opportunity. I only tested this under windows, so I don't know if it's a driver issue or a generic iup issue. Thanks, -- Nicolas Noble |