set text alignment of rich text ctrl

how to align text right and center because wx.TE_RIGHT and wx.TE_CENTER is not working in the code below

 import wx
import wx.richtext as rtc
class test(wx.Dialog):
    def __init__(self, *args, **kwds):
       wx.Dialog.__init__(self, *args, **kwds)
       self.V=rtc.RichTextCtrl(self, size=(400,90),style=wx.TE_RIGHT|rtc.RE_MULTILINE)
 if __name__ == '__main__':
  app = wx.App()
  dialog = test(None, -1)

  dialog.Show()
  app.MainLoop()

Ahmed,
The TE_* flags apply to text controls rather than rich text
controls, (although confusingly you can use a flag on a text control
to give it rich content), in a rich text control you need to give
sections of text flags by using things like:
Which I lifted from the demo.
This is working fine on my machine which I am running wxPython
3.0.1.0 gtk2 on python 2.7.8 Ubuntu 14.10.
Gadget/Steve

···

On 04/01/15 19:36, ahmed abbas wrote:

                  how to align text right and center because

wx.TE_RIGHT and wx.TE_CENTER is not working in the
code below

 import wx
import wx.richtext as rtc
class test(wx.Dialog):
    def __init__(self, *args, **kwds):
       wx.Dialog.__init__(self, *args, **kwds)
       self.V=rtc.RichTextCtrl(self, size=(400,90),style=wx.TE_RIGHT|rtc.RE_MULTILINE)
 if __name__ == '__main__':
  app = wx.App()
  dialog = test(None, -1)

  dialog.Show()
  app.MainLoop()

  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](https://groups.google.com/d/optout).

` self.rtc.BeginAlignment(wx.TEXT_ALIGNMENT_CENTRE)``

``        self.rtc.BeginBold()``

``

``        self.rtc.BeginFontSize(14)``

``              self.rtc.WriteText("Welcome to wxRichTextCtrl, a

wxWidgets control for editing and presenting styled text and
images")``

``        self.rtc.EndFontSize()``

``        self.rtc.Newline()``

``

``        self.rtc.BeginItalic()``

``        self.rtc.WriteText("by Julian Smart")``

``        self.rtc.EndItalic()``

``

``        self.rtc.EndBold()`

thank you that is resolve the problem