Do I call a root (“okno
”) to function call? I would understand the following code excerpt that I have three values, which I am sending to positional arguments of the function. So okno
goes via parent
to the value of master
attribute in ttk.Frame
. Thus when later on I create ttk.Frame
it is placed on its master okno
.
...
def vytvori_segment(parent, text_znacky, text_tlacitka):
ram = ttk.Frame(master = parent)
#Rozvržení
ram.rowconfigure(0, weight = 1)
ram.columnconfigure((0,1,2), weight = 1, uniform = "a")
#Widgety
ttk.Label(master = ram, text = text_znacky).grid(row = 0, column = 0, sticky = "nsew")
ttk.Button(master = ram, text = text_tlacitka).grid(row = 0, column = 1, sticky = "nsew")
return ram
okno = tk.Tk()
okno.title("Kombinace OOP a funkčního programování")
okno.geometry("400x600")
vytvori_segment(okno, "Značka", "Tlačítko").pack(expand = True, fill = "both", padx = 5, pady =2)
vytvori_segment(okno, "Značka 1", "Tlačítko 1").pack(expand = True, fill = "both", padx = 5, pady =2)
...
okno.mainloop()
Or maybe if I consider what “placeholder = placeholder” means in the function call, I conclude that I am not calling okno
variable from the function call because “master = okno
” or just “okno
” would be understood as a keyword parameter, not an attribute with a value. Is that right?