# TE\_CENTRE not defined in Windows

**URL:** <https://www.ruby-forum.com/t/te-centre-not-defined-in-windows/153134>\
**Category:** wxRuby\
**Created:** [November 12, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/te-centre-not-defined-in-windows/153134 "2008-11-12T15:25:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [November 12, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/te-centre-not-defined-in-windows/153134/1 "2008-11-12T15:25:22Z")

</div>

When I try to create a TextCtrl with the TE\_CENTRE style I get the  
message  
“uninitialized constant Wxruby2::TE\_CENTRE”. I have the same problem  
with  
TE\_RIGHT, but TE\_LEFT and all the other TE\_\* styles seem to work fine.  
I am  
running Windows XP, Ruby 1.8.6 and WxRuby 1.9.9.

Has anyone else seen this?

Eric R.

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [November 12, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/te-centre-not-defined-in-windows/153134/2 "2008-11-12T15:48:17Z")

</div>

Hi

Eric R. wrote:

> When I try to create a TextCtrl with the TE\_CENTRE style I get the  
> message “uninitialized constant Wxruby2::TE\_CENTRE”. I have the same  
> problem with TE\_RIGHT, but TE\_LEFT and all the other TE\_\* styles seem  
> to work fine. I am running Windows XP, Ruby 1.8.6 and WxRuby 1.9.9.

Thanks for the report. It’s strange. The constants are definitely there  
in the source files, but I also find TE\_RIGHT and TE\_CENTRE to be  
undefined (1.9.9, SVN HEAD on OS X).

To work round it for now, you can use the following constants which have  
the same value (in the C++ source, the TE\_ constants are just aliases  
for these).

Wx::TE\_RIGHT = Wx::ALIGN\_RIGHT  
Wx::TE\_CENTRE = Wx::ALIGN\_CENTER\_HORIZONTAL

alex
