Home > other >  Tkinter interface order problems
Tkinter interface order problems

Time:01-15

file 1: file called doc1. Py
The from tkinter import *
The from doc2 import B
Class A:
Def main (self) :
The self. The root=Tk ()
The self. The root. The geometry (' 942 x647)
Btn1=Button (self. Root, text='test', the command=B)
Btn1. Place (x=69, y=497, height=40, width=141)
The self. The root. The mainloop ()
(A). The main ()

file 2: file called doc2. Py
The from tkinter import *
The from tkinter import filedialog
Class B:
Def __init__ (self) :
Self. Root_1=Tk ()

Self. Root_1. Geometry (' 670 x630)
Btn1=Button (self root_1, text='... ', the command=self. Path)
Btn1. Place (x=200, y=200)
Self. Root_1. Mainloop ()

Def path (self) :
Result=filedialog. Askopenfilename (filetype=[(' text files', '. TXT ')])
Print (result)

1 interface button calls file 2 interface, file 2 interface button calls filedialog file selection screen, but in the filedialog file selection interface, file 1 interface will cover on file 2, tried to file 2 top interface, but there will be a file selection interface can't show in the front, a great god with,
  • Related