I'm trying to use tkinter to create an application that using Arabic lang. the problem is the direction of cursor always from left to right that making user confused when selecting (highlighting )Arabic text inside an entry(the selected text get reversed letters position).
I think that you have to check the code of Tkinter.py and see if you can tweak it (but like creating an extension and not overwriting the code), maybe if you see that you can do something about these lines:
def get(self):
"""Return the text."""
return self.tk.call(self._w, 'get')
def icursor(self, index):
"""Insert cursor at INDEX."""
self.tk.call(self._w, 'icursor', index)
def index(self, index):
"""Return position of cursor."""
return getint(self.tk.call(
self._w, 'index', index))
def insert(self, index, string):
"""Insert STRING at INDEX."""
self.tk.call(self._w, 'insert', index, string)
def scan_mark(self, x):
"""Remember the current X, Y coordinates."""
self.tk.call(self._w, 'scan', 'mark', x)
All the previous lines are in the Entry class:
class Entry(Widget, XView):
"""Entry widget which allows to display simple text."""
I don't have references of support available for Arabic writing in Python, but that doesn't meant that it doesn't exists , maybe there is some dll or plugin waiting to be uncovered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With