I am trying to create a command terminal like window..I have used the
following code..Problem is that it set the command prompt as ">>>" that is
editable.
I want window with fixed ">>>" with cursor waiting for command...now the
issue is that user can easily delete ">>>" as it is a simple text..
Is it any way to fixed this part of text in wx.textctrl or in any other
control.
class MyFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(400,400))
self.SetPosition(wx.Point(0,0))
self.cmdArea = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.cmdArea.SetValue(">>>")
self.Show(True)
I don't think you can do this with wx.TextCtrl. But you can, maybe sort
of, with StyledTextCtrl. Notice this (from here
http://www.yellowbrain.com/stc/styling.html):
*StyleSetChangeable(style, changeable)*
This is an experimental and incompletely implemented style attribute. The
default setting is changeable set true but when set false it makes text
read-only. Currently it only stops the caret from being within
not-changeable text and does not yet stop deleting a range that contains
not-changeable text.
The values *style* and *changeable* are integers. The return value is None.
I noticed the shell on the wxPython IDE I use is probably using this, since
I can't move the caret into the >>> area, but I can highlight everything
around it and delete it. That said, I've used IDE for many years and never
once thought to do that, so perhaps it is good enough?
It may also be updated by now, I haven't looked carefully at all.
Che
···
On Mon, Aug 4, 2014 at 3:21 PM, Hemadri Saxena <hemadri.saxena@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.