Tkinter を使用して Python で記述されたグラフィカルな解析アプリケーションを維持しています。オプションで、Canvas ウィジェットを使用して作成したスクロール可能なスプレッドシートに結果を表示します。ただし、スケーラビリティに問題があるようです。メイン キャンバスが大きすぎる場合、結果が表示されるウィンドウを破棄しようとすると、プログラムが応答を停止し、強制終了する必要があります。表示されるデータが少ない場合は、通常どおり破棄できます。これは Tkinter/大きな Canvi の既知の問題ですか? これらのフリーズを防ぐために何かできることはありますか?
#Function being called to destroy window
def justexit():
savepopup.destroy() #Destroy the popup asking to save (that called this function)
deleteall() #Destroy canvi and their contents
popup.destroy() #Destroy the window containing all the canvi
def deleteall():
for i, itemset in enumerate(items): #Items stores lists containing every item added to the canvi
for item in itemset:
canvi[i].delete(item)
canvi[i].destroy()
そして、私の見積もりは少し外れていました。実際には何万ものアイテムがプレイされていますが、スローダウンがこれほど明白になるとは思いません.