I have a huge list l1
of almost 1074 app names in it
['10 Best Foods for You' '104 找工作 - 找工作 找打工 找兼職 履歷健檢 履歷診療室' '11st' ...
'Hotwire Hotel & Car Rental App' 'Housing-Real Estate & Property'
'Houzz Interior Design Ideas']
I want to display all the apps in the same window as below, but all of them aren't visible.
Im getting the following error in the console:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/Samit Patil/Desktop/PlaystoreStudy Project/test_gui.py", line 496, in <lambda>
tk.Button(frame, text='Select query', width='15', font=("Open Sans", 13, 'bold'), bg='brown', fg='white',command=lambda c=i:query(c+1)).grid(row=i,column=1,sticky=W)
File "C:/Users/Samit Patil/Desktop/PlaystoreStudy Project/test_gui.py", line 439, in query
populate(frame)
File "C:/Users/Samit Patil/Desktop/PlaystoreStudy Project/test_gui.py", line 418, in populate
tk.Label(frame, text=l1[5], width='80',anchor=W,relief=GROOVE, height="4", font=("Calibri", 10, 'bold'), fg='black', bg='Green',wraplength=500).grid(row=i,column=0,sticky=W)
File "C:\ProgramData\Anaconda3\lib\tkinter\__init__.py", line 2766, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "C:\ProgramData\Anaconda3\lib\tkinter\__init__.py", line 2299, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: character U+1f602 is above the range (U+0000-U+FFFF) allowed by Tcl
My code:
qy14apps = Toplevel(screen2)
qy14apps.title("Select one app")
adjustWindow(qy14apps) # configuring the window
l1=list_apps()
print (len(l1))
def onFrameConfigure(canvas):
canvas.configure(scrollregion=canvas.bbox("all"))
def populate(frame):
for i in range(len(l1)):
tk.Label(frame, text=l1[i], width='80',anchor=W,relief=GROOVE, height="4", font=("Calibri", 10, 'bold'), fg='black', bg='Green',wraplength=500).grid(row=i,column=0,sticky=W)
#l2=Label(text="\n", bg='white')
#l2.grid(row=i+1,column=0)
tk.Button(frame, text='Select app', width='15', font=("Open Sans", 13, 'bold'), bg='brown', fg='white',command="").grid(row=i,column=1,sticky=W)
canvas = tk.Canvas(qy14apps, borderwidth=0, background="#ffffff")
frame = tk.Frame(canvas, background="#ffffff")
vsb = tk.Scrollbar(qy14apps, orient="vertical", command=canvas.yview)
canvas.configure(yscrollcommand=vsb.set)
vsb.pack(side="right", fill="y")
canvas.pack(side="left", fill="both", expand=True)
canvas.create_window((4,4), window=frame, anchor="nw")
frame.bind("<Configure>", lambda event, canvas=canvas: onFrameConfigure(canvas))
populate(frame)
I dont understand where im going wrong, is it because the list is too huge? I have applied the same concept for a list of 20 elements and it worked then. Any help would be highly appreciable. Thanks.