如何更改设置时如何设置我的tkinter设置类更新我的函数类?

时间:2016-12-09 11:29:12

标签: python-3.x tkinter application-settings

所以我有类似于这个设置的东西:

class FrameBase(tk.Tk):
    def __init__(self,*args,**kwargs)
        ## Create 3 windows, the front, settings and the function


class Front(tk.Frame):
   def __init__(self,parent,control):
         ## Has buttons to navigate between settings and the function

我的问题是,在 init 解析了一次之后,我的函数不会更新从settings-Class中获取的值。他们目前的沟通方式大致如下:

class Front(tk.Frame):
    def __init(self,parent,control):
         settings = Settings(self, self) ## (self, self) required because of the infrastructure as far as I can tell. 
                                         ## It does bring the setting values fine so that's not a problem in and of itself.
         settingvalues = settings.bring_settings()




    def magic()
          #Does magic based on the settingvalues


class Settings(tk.Frame):
       def __init(self,parent,control):
             # user can change settings 



       def bring_settings(self):
             # return setting values

问题在于,基本上我不知道如何在每次更改设置,打开功能窗口或每隔x个间隔(这可能是这个时间间隔)时发出功能请求/获取设置值最重?)

0 个答案:

没有答案