[wxPython] Right alignment in wxTextCtrl?

Donnal Walter donnalcwalter at yahoo.com
Sun Jan 5 07:05:42 EST 2003


"F. GEIGER" <fgeiger at datec.at> wrote in message
news:3e17fbf1 at news.swissonline.ch...
> I'd like to create a NumberTextbox class, which differs from the standard
> wxTextCtrl in that it right aligns its text (which are numbers, of
course).
> As I cannot find the right property for achieving this (the Style methods
> seem to change the font and its appearance only), I'm afraid I have to
> invent something by myself. But before I go into interstion point calcs
> and/or string padding or whatever, I'd like to ask, if there's anything
I've
> missed.

from wxPython.lib.rightalign import wxRightTextCtrl

In the demo for wxPython 2.3.3.1 look at wxRightTextCtrl under "More
Windows/Controls".

IIRC, some native controls (MSW, for example) also support
'style=wxTE_RIGHT'. You might want to give this a try this first.

Donnal Walter
Arkansas Children's Hospital









More information about the Python-list mailing list