Maximum length of text in wx.TextCtrl

670 views
Skip to first unread message

Martin Manns

unread,
May 28, 2012, 4:17:48 PM5/28/12
to wxpytho...@lists.wxwidgets.org
Hi,

According to the docs, the maximum text length that a wx.TextCtrl
supports depends on the platform.

1) I am looking for a method that returns this value.

2) Is there a text entry widget that supports long lines (>64k)?
My use case is giving access to code that includes serialized data.

Thanks,

Martin

Robin Dunn

unread,
May 29, 2012, 1:43:06 PM5/29/12
to wxpytho...@googlegroups.com
A wx.TextCtrl with one of the wx.TE_RICH styles.


--
Robin Dunn
Software Craftsman
http://wxPython.org

Martin Manns

unread,
May 29, 2012, 5:20:28 PM5/29/12
to wxpytho...@lists.wxwidgets.org
On Tue, 29 May 2012 10:43:06 -0700
Robin Dunn <ro...@alldunn.com> wrote:

> On 5/28/12 1:17 PM, Martin Manns wrote:
> > 2) Is there a text entry widget that supports long lines (>64k)?
>
> A wx.TextCtrl with one of the wx.TE_RICH styles.

That does not work here.

I have tried:

style=wx.TE_PROCESS_ENTER|wx.TE_RICH

and the line is truncated at 65534 characters.

I am working with Debian unstable:
wxPython 2.8.12.1
(wxGTK, unicode, gtk2, wx-assertions-off, SWIG-1.3.29)
Running on Python 2.7.3rc2

Regards

Martin

Martin Manns

unread,
May 30, 2012, 6:58:10 PM5/30/12
to wxpytho...@lists.wxwidgets.org
On Tue, 29 May 2012 10:43:06 -0700
Robin Dunn <ro...@alldunn.com> wrote:

> On 5/28/12 1:17 PM, Martin Manns wrote:
> > 2) Is there a text entry widget that supports long lines (>64k)?
>
> A wx.TextCtrl with one of the wx.TE_RICH styles.

Robin Dunn

unread,
Jun 1, 2012, 1:30:51 PM6/1/12
to wxpytho...@googlegroups.com
Sorry, I thought you meant total text length. There probably isn't
anything that can be done to make the native text widgets allow larger
line lengths. If all you need is the ability to display the text then
you can easily create a custom widget that allows longer lines, although
you may still run into issues with a limited range supported by the
scrollbars. On the other hand, I know I personally hate reading text
with lines longer than about 200 characters, so you might want to think
about some other way to display the data that will make your users happier.

Martin Manns

unread,
Jun 3, 2012, 7:16:28 AM6/3/12
to wxpytho...@lists.wxwidgets.org
On Fri, 01 Jun 2012 10:30:51 -0700
Robin Dunn <ro...@alldunn.com> wrote:

> Sorry, I thought you meant total text length. There probably isn't
> anything that can be done to make the native text widgets allow
> larger line lengths. If all you need is the ability to display the
> text then you can easily create a custom widget that allows longer
> lines, although you may still run into issues with a limited range
> supported by the scrollbars. On the other hand, I know I personally
> hate reading text with lines longer than about 200 characters, so you
> might want to think about some other way to display the data that
> will make your users happier.

Thank you for pointing out the bad usability.

I am using the Textctrl as an Editor in a wx.Grid. When cell editing is
started, the wx.TextCtrl automatically truncates the text. Therefore, I
would have to pre- and postprocess the code before and after editing.

I would prefer a widget that can be used as editor for arbitrary
cell content lengths in a wx.Grid. Better usability than a TextCtrl
of course would be nice.

Do you have an idea what to use?

Regards

Martin

Reply all
Reply to author
Forward
0 new messages