Questions tagged [textctrl]

A widget in the wxWidgets framework for displaying and editing text.

TextCtrl is a widget in the wxWidgets framework for displaying and editing text.

Related Tags

62 questions
15
votes
1 answer

Changing the font on a wxPython TextCtrl widget

I'd like to set the font of a wx.TextCtrl widget to Consolas, or at least another monospaced font. How would I go about this?
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
15
votes
2 answers

Getting String from A TextCtrl Box

How to get the strings from a TextCtrl box? Here is the practice code: import wx class citPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id) wx.StaticText(self, -1, "Choose put you would…
Kevin
  • 4,211
  • 10
  • 33
  • 40
11
votes
7 answers

Is it possible to limit TextCtrl to accept numbers only in wxPython?

I want to have a text control that only accepts numbers. (Just integer values like 45 or 366) What is the best way to do this?
Jeroen Dirks
  • 7,705
  • 12
  • 50
  • 70
4
votes
2 answers

Change the size of wx.TextCtrl dynamically

I have a problem with wx.TextCtrl. I just want to set the size of the control box but i want to do it dynamically. And this does not work for any reason. Here i have my source code. #!/usr/bin/env python # -*- coding: utf-8 -*- import wx class…
Max16hr
  • 438
  • 2
  • 5
  • 20
4
votes
2 answers

Making a wxPython TextCtrl respond to cr or tab

I think this must be a pretty basic question, but I have Googled it to death with no clear answer, so here goes: I have a TextCtrl and I want a pretty basic sequence of events: 1) The user moves focus to the control by hook or by crook. 2) The user…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
4
votes
1 answer

wxPython wx.TextCtrl dynamically resizing to fill panel width

I want a wx.TextCtrl to take the entire remaining width of a panel. It is placed with a wx.StaticText and a wx.Button in a horizontal wx.BoxSizer in a vertical wx.BoxSizer in a wx.lib.scrolledpanel.ScrolledPanel (which is self below): # create…
virtualnobi
  • 1,140
  • 2
  • 11
  • 35
3
votes
1 answer

wxPython: How to change the font color in textctrl with a checkbox?

I have some checkboxes like this self.myCB = wx.CheckBox(panel, id=02, label="someString", pos=(20, 25)) behind every checkbox there's a TextCtrl like this self.myTC = wx.TextCtrl(panel, value=" 0", id=self.myCB.GetId(), pos=(320, 25), size =…
user1106770
  • 1,389
  • 4
  • 12
  • 14
3
votes
1 answer

How to change ForegroundColour of a disabled TextCtrl from wxPython

how can I change the foregroundcolor of a disabled TextCtrl from wxPython? I mean, when I change the color with SetForegroundColour it only changes for enabled status. When I disable the TextCtrl, it remains dark grey even if I set it red, for…
debihiga
  • 246
  • 2
  • 10
2
votes
1 answer

Remove last character from wxPython wxTextCtrl?

I am trying to remove the very last character from a TextCtrl object in wxPython. I'm using wxPython 2.8.12 and Python 2.7.2. My code is as follows: def btnBkClicked(self, e): self.txtItem.Remove(self, (self.txtItem.GetLastPosition()[-1]),…
Cody Dostal
  • 311
  • 1
  • 3
  • 13
2
votes
1 answer

preventing newline after wxpython TextCtrl.WriteText()

I have a shell-like console for my app, which prompts with ">>>" after every command. The problem is every time I have my shell WriteText(">>> "), it also appends a new line. The user can backspace up to the correct line, but this just looks…
Shaunak
  • 27
  • 3
2
votes
1 answer

searchctrl EVT_LEFT_DOWN event is not working (wxpython)

I tried to make a mouse event with searchctrl, when I click the searchctrl to enter some code. My goal is that when I click the searchctrl(edit to text or wirte), a virtual keyboard(onboard) will start. I found that searchctrl is low category…
LEELOLEE
  • 83
  • 1
  • 8
2
votes
1 answer

wxpython textctrl line and column

I am writing a text editor using wxpython. I want to display the line & column numbers based on the position of the text pointer(when changed using keyboard or mouse), in the statusbar. I tried to do it using the below code: import wx class…
ssv
  • 125
  • 1
  • 11
2
votes
2 answers

wxPython TextCtrl assertion error: wx.wxEVT_COMMAND_TEXT_ENTER not a PyEventBinder instance

Trying to make a wxPython TextCtrl to react on ENTER, I get an assertion error: self.fileNameInput = wx.TextCtrl (self, style=wx.TE_PROCESS_ENTER) self.fileNameInput.Bind (wx.wxEVT_COMMAND_TEXT_ENTER, self.onRename) terminates with an assertion…
virtualnobi
  • 1,140
  • 2
  • 11
  • 35
2
votes
1 answer

wxpython textctrl change caret colour

I'm using a wxpython textctrl & would like to hide the caret. After a lot of searching it would appear that the best approach would be to simply change it's colour to white. However I can not work out how to do this. I found the following…
Clinton Moffat
  • 211
  • 1
  • 2
  • 12
2
votes
3 answers

wxPython - wx.TextCtrl - forcing styles

just a simple question on a wx.TextCtrl element. i have this text field where on an application, where the user can add a string on it. i want a text field with a red text on it. so i've generated this code: self.hRepositoryTextfield =…
axel
  • 3,778
  • 4
  • 45
  • 72
1
2 3 4 5