here is an update on adding a new elide widget text box in-between the other 2.
import tkinter as tk
root = tk.Tk()
root.title("Testing widgets for Elide")
# create 'line number' text box
line_text = tk.Text(root, wrap="none", width=5, insertwidth=0) # don't want the cursor to appear here
line_text.pack(fill="y", side="left")
# added > create elide button text box
line_textR = tk.Text(root, wrap="none", width=2, insertwidth=0) # don't want the cursor to appear here
line_textR.pack(fill="y", side="left")
# create 'code' text box
text_box = tk.Text(root, wrap="none")
text_box.pack(fill="both", expand=True, side="left")
# add a tag to line number text box (need text to be at the right side)
line_text.tag_configure("right", justify="right")
# add some text into the text boxes
for i in range(13):
line_text.insert("end", "%s \n" % (i+1)) # add line numbers into line text box (now on the left side)
line_text.tag_add("right", "1.0", "end")
for i in range(13):
text_box.insert("end", "%s \n" % ("some text here at line number #" + str(i+1))) # add some text int the main text box (now on the right side)
for i in range(13):
line_textR.insert("end", " \n") # add blank space on each line for the elide widget text box _ this allows for widget placement by line number (now in the middle)
# add button to use as elide +/- (inside text boxes? _ not sure which widget is correct (button, label, image)?
elide_button = tk.Button(line_textR, text="-")
line_textR.window_create("11.0", window=elide_button) # *** test ***
root.mainloop()