Using only tkinter (bytes offset? need more testing):
- start:
'1.0', '0.0 + N chars'
- middle:
'1.0 + Nc', 'end - Nc'
# both N need to be the same - end:
'end - Nc', 'end'
# need to use N + 1 here
N is to be replaced by the number of char/bytes needed to act on. This wasn't tested extensively, but it seems to hold up when tested with text.delete:
def testdelete_start(event=None):
text.delete('1.0', '0.0 + 3 chars') # change this line here
def testdelete_middle(event=None):
text.delete("1.0 + 13c", "end - 13c") # change this line here
def testdelete_end(event=None):
text.delete("end - 3c", "end") # change this line here
# the above made to be used with key bindings, mostly for testing on my part