I’m using Fedora 16 with wxPython 2.9.3.1 and I’m having problems setting a textctrl to be multiline. It works fine on both Windows 7 and Fedora 16 if I do this…
text = wx.TextCtrl(frame, -1, ‘test’, size=(200,200), style=wx.TE_MULTILINE)
However, if I do it this way it only works on Windows 7 but throws errors/warnings on Fedora 16…
text = wx.TextCtrl(frame, -1, ‘test’, size=(200,200))
text.SetWindowStyle(wx.TE_MULTILINE)
This is the warning I get on Linux…
(debug.py:2094): GLib-GObject-WARNING **: invalid cast from GtkEntry' toGtkTextView’
I first noticed this using XRC to define a textctrl to be multiline but it threw a different message on Linux…
wx._core.PyAssertionError: C++ assertion “IsSingleLine()” failed at /tools/wxPython-src-2.9.3.1/src/gtk/textctrl.cpp(828) in GetEditable(): shouldn’t be called for multiline
I’m guessing there are two different widgets on Linux whereas on Windows, it’s just one. Thus you probably have to instantiate it one way or the other, not change it after it’s been created. We’ll see if my hunch is right when Robin jumps in here…
Mike
···
On Tuesday, May 22, 2012 11:06:23 AM UTC-5, blissend wrote:
Hi,
I’m using Fedora 16 with wxPython 2.9.3.1 and I’m having problems setting a textctrl to be multiline. It works fine on both Windows 7 and Fedora 16 if I do this…
text = wx.TextCtrl(frame, -1, ‘test’, size=(200,200), style=wx.TE_MULTILINE)
However, if I do it this way it only works on Windows 7 but throws errors/warnings on Fedora 16…
text = wx.TextCtrl(frame, -1, ‘test’, size=(200,200))
text.SetWindowStyle(wx.TE_MULTILINE)
This is the warning I get on Linux…
(debug.py:2094): GLib-GObject-WARNING **: invalid cast from GtkEntry' to GtkTextView’
I first noticed this using XRC to define a textctrl to be multiline but it threw a different message on Linux…
wx._core.PyAssertionError: C++ assertion “IsSingleLine()” failed at /tools/wxPython-src-2.9.3.1/src/gtk/textctrl.cpp(828) in GetEditable(): shouldn’t be called for multiline
Yep. You must specify this style when the textctrl is created, it can't be changed after.
···
On 5/22/12 9:15 AM, Mike Driscoll wrote:
On Tuesday, May 22, 2012 11:06:23 AM UTC-5, blissend wrote:
Hi,
I'm using Fedora 16 with wxPython 2.9.3.1 and I'm having problems
setting a textctrl to be multiline. It works fine on both Windows 7
and Fedora 16 if I do this...
text = wx.TextCtrl(frame, -1, 'test', size=(200,200),
style=wx.TE_MULTILINE)
However, if I do it this way it only works on Windows 7 but throws
errors/warnings on Fedora 16...
text = wx.TextCtrl(frame, -1, 'test', size=(200,200))
text.SetWindowStyle(wx.TE_MULTILINE)
This is the warning I get on Linux...
(debug.py:2094): GLib-GObject-WARNING **: invalid cast from
`GtkEntry' to `GtkTextView'
I first noticed this using XRC to define a textctrl to be multiline
but it threw a different message on Linux...
wx._core.PyAssertionError: C++ assertion "IsSingleLine()" failed at
/tools/wxPython-src-2.9.3.1/src/gtk/textctrl.cpp(828) in
GetEditable(): shouldn't be called for multiline
Am I doing something wrong here?
Thanks,
Adam
I'm guessing there are two different widgets on Linux whereas on
Windows, it's just one. Thus you probably have to instantiate it one way
or the other, not change it after it's been created. We'll see if my
hunch is right when Robin jumps in here...