Record tkinter and cursor right to left

I am trying to use tkinter to create an application using Arabic. the problem is that the cursor is always from left to right, which makes the user confused when selecting (highlighting) Arabic text inside the record (the selected text gets the position in the reverse order).

enter image description here

+4
source share
1 answer

I think you need to check the Tkinter.py code and see if you can configure it (but like creating an extension and not rewriting the code), perhaps 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 previous lines are in the Entry class:

class Entry(Widget, XView):
    """Entry widget which allows to display simple text."""

, Python, , , , dll , .

+1

Source: https://habr.com/ru/post/1539329/


All Articles