dmnfarrell / tkintertable

A pure Python library for adding tables to a Tkinter application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output: "Did not find preferences!!!"

testor2897 opened this issue · comments

Hallo,

I get the following console output creating a table:

Did not find preferences!!!
could not save
could not save

The table is nevertheless build and working (great!)

I am working with tkintertable 1.3.3 on Python 3.79.
Addition: It seems to be connected to use of venv (virtual environment)

How can I avoid this console output?

This code causes the problem:

  import tkinter as tk
  from tkintertable import TableCanvas, TableModel

  class MyApp(tk.Tk):
    def InitLocale(self):
        pass

    def __init__(self, parent):
      tk.Tk.__init__(self, parent)
      self.parent = parent
      self.mainWidgets()
...

    def mainWidgets(self):
      # don't assume that self.parent is a root window.
      # instead, call `winfo_toplevel to get the root window
      self.winfo_toplevel().title("Elliptical Regression")
      self.geometry("1000x800")
      self.modus = "build"
...
      self.hFrame2 = tk.Frame(master=self, height=90)
      self.hFrame2.pack(side='top', fill='x', expand=True, padx=20, pady=20)
      
      self.hFrame = tk.Frame(master=self)
      self.gridFrame = tk.Frame(self.hFrame2)
      self.gridFrame.pack(side='left', padx=10)
      self.grid = TableCanvas(parent=self.gridFrame)

The console output is created by the last line.
The right side of "=" is actually throwing the message.

This should only appear the first time you use the package. Unless it can't save the preferences file for some reason. It won't really matter if you just use the defaults anyway.