Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PRESS ENTER IN ADDRESS BAR
- #PRESS ENTER IN ADDRESS BAR
- #PRESS ENTER IN ADDRESS BAR
- import tkinter as tk
- recheck=False
- sample_tree=[
- ("namno.duckdns.org"),
- ("""Established 01 IV 2024"
- "Lina Inverse Rulez!"""),
- (""" ╱╲
- ╱ ╲
- ╱ ╲
- ▏ ▕ ▕
- ▏ ▕ ▕
- ╲ ╲ ╱
- ╱╲ ╲
- ▏ ╲ ╲
- ▏ ▕ ▕
- ▏ ▕ ▕
- ╲ ╱
- ╲ ╱
- ╲╱ """),
- ("My thoughts on various things"),
- ("""This site on runs on raspberry pi 1. It works without any sort of cooling right now, but I think it would be for the better if I stick radiator there.
- test test test
- You should be able to view this block of text all at once"""),
- ]
- def view_document(event):
- global recheck
- for el in sample_tree:
- if recheck:
- break
- i=tk.Text(txfr, borderwidth=0, height=1, relief=tk.FLAT)#COMMENT HERE TO "FIX" the bug
- #i=tk.Text(fr, borderwidth=0, height=1, relief=tk.FLAT)#UNCOMMENT HERE TO "FIX" the bug
- #i=tk.Text(fr, borderwidth=0, relief=tk.FLAT)#UNCOMMENT THIS and comment previous line TO MAKE LINES BIG FOR NO REASON #UNCOMMENT HERE TO "FIX" the bug
- #i=tk.Text(txfr, borderwidth=0, relief=tk.FLAT)#UNCOMMENT THIS and comment previous line TO MAKE LINES BIG FOR NO REASON
- i.insert("end", el)
- textarray.append(i)
- print("=====================================")
- for i in textarray:
- logic_lines=i.count("1.1", "end", "lines", return_ints=True)
- print("LOGICAL LINES="+str(logic_lines))
- for j in range(1, logic_lines+1):
- print("LINE "+str(j)+": "+str(i.count(
- str(j)+".1",
- str(j)+".end",
- "update",
- "chars",
- "displaychars",
- "displayindices",
- "displaylines",
- "indices")))
- if recheck:
- continue
- i["state"]="disable"
- i.pack(expand=1, fill="both")
- recheck=True
- w=tk.Tk()
- w.geometry("640x480")
- textarray=[]
- fr=tk.Frame(w)
- #adress_var=tk.StringVar()
- #adress=tk.Entry(fr, justify="left",relief="sunken",textvariable=adress_var)
- adress=tk.Entry(fr, justify="left",relief="sunken")
- adress.pack(fill="x")
- adress.bind('<Return>', view_document )
- canv=tk.Canvas(fr)#COMMENT HERE TO "FIX" the bug
- canv.pack(side="left", fill="both", expand=True)#COMMENT HERE TO "FIX" the bug
- txfr=tk.Frame(canv)#COMMENT HERE TO "FIX" the bug
- canv.create_window((0, 0), window=txfr, anchor="nw", tags=("txfr"))#COMMENT HERE TO "FIX" the bug
- #txfr=tk.Frame(fr)#UNCOMMENT HERE TO "FIX" the bug
- fr.pack(fill="both", expand=True)
- #txfr.pack(fill="both", expand=True)#UNCOMMENT HERE TO "FIX" the bug
- w.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment