This is my first post here!
First here's the github link (I'm noob on github too) of my project.
Edited:
So here is a example of what I want to do, I have a big Tkinter class with frames,labels,menus,buttons and all and some functions in it too.
I want to let the UI description in my MakeUI() and move my funcs to another file, but I need to still have access to widgets.
< Main.py >
# -*- coding: utf-8 -*-
from tkinter import *
from Interface import *
Fenetre = Tk()
UI = MakeUI(Fenetre)
UI.mainloop()
UI.destroy()
< Interface.py >
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter.filedialog import *
class MakeUI(Frame):
def __init__(self, Fenetre, **kwargs):
# Héritage
Frame.__init__(self, Fenetre, width=1500, height=700, **kwargs)
self.pack(fill=BOTH)
self.FrameInfos = LabelFrame(self, text="Choix des paramètres", padx=2, pady=2)
self.FrameInfos.pack(fill="both", expand="yes", padx=5, pady=5)
self.MsgInfosCarte = Label(self.FrameInfos, text="Example", width=45)
self.MsgInfosCarte.pack(padx=2, pady=2)
def AfficherCarte(self):
self.MsgInfosCarte["text"] = "OK"
And now in this example, I need to move the AfficherCarte function to another file like MapFuncs.py or else. And I want MakeUI to be able to call other files funcs and other files funcs to modify the interface.
I can't manage to do it properly.
Thanks for your help.