type in a TextCtrl

can You type in a TextCtrl so that the text starts after a certain
number of pixels and not immediately?

···

--
Fabio

Fabio Spadaro wrote:

can You type in a TextCtrl so that the text starts after a certain
number of pixels and not immediately?

No, but here is a way to make it mostly appear to be doing what you want (how much depends on the platform):

* make a class derived from wx.PyPanel
* have it use a style of wx.TAB_TRAVERSAL|wx.BORDER_THEME
* set its bg color to be the same bg as the textctrl
* put a textctrl on it at the pixel offset you want, and give it a style of wx.BORDER_NONE
* give it an EVT_SIZE handler that positions and sizes the textctrl as needed, or use a sizer.
* give it a DoGetBestSize method that returns a wx.Size object of the textCtrl's best size with your pixel offset added to the width.

···

--
Robin Dunn
Software Craftsman