简体   繁体   中英

How to change wxpython direction?

I have this simple code:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# simple.py

import wx

app = wx.App()

frame = wx.Frame(None, title='Simple application')
frame.Show()

app.MainLoop()

but when I get output my direction is RTL.How can I change frame direction to ltr? 在此处输入图片说明

After on day test,I found this code:

class DefaultFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        wx.Frame.__init__(self, None, title="Default Frame", style=wx.DEFAULT_FRAME_STYLE)
        self.SetLayoutDirection(wx.Layout_LeftToRight)


if __name__ == '__main__':
    django_init()
    app = wx.App()
    frame = DefaultFrame()
    frame.Show()
    app.MainLoop()

And result is below:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM