0

Every program that I'm making using pygtk is right-alignment by default (maybe because my default language is right to left language?) How can I change it? pygtk right alignment example

ergosys
  • 47,835
  • 5
  • 49
  • 70
Jah
  • 1,019
  • 1
  • 11
  • 25

2 Answers2

1

The orientation of the widgets in a container depends on the locale. You can change the locale settings on Windows by setting the LANG environment variable.

set LANG=en_US
something.py

On Linux you can do the same with the following commands

export LANGUAGE=en_US
something.py

or simply

LANGUAGE=en_US something.py
Szilárd Pfeiffer
  • 1,636
  • 1
  • 12
  • 6
1

And if you want to adjust direction of widgets inside a widget (for example a window), regardless of system locale:

widget.set_direction(gtk.TEXT_DIR_LTR)

And to change default direction for everything inside your app:

gtk.widget_get_default_direction(gtk.TEXT_DIR_LTR)

Or gtk.TEXT_DIR_RTL instead of LTR

saeedgnu
  • 4,110
  • 2
  • 31
  • 48