from Tkinter import * from gui7 import HelloPackage # or get from gui7c--__getattr__ added frm = Frame() frm.pack() Label(frm, text='hello').pack() part = HelloPackage(frm) part.pack(side=RIGHT) # fails! -- need part.top.pack(side=RIGHT) frm.mainloop()
from tkinter import * import tkinter from gui7 import HelloPackage # chamando tk, obs: tem que chamar tk para funcionar/ nao livro nao eh chamado root = Tk() frame = Frame(root) frame.pack() Label(frame, text='hello/ ola').pack() part = HelloPackage(frame) root.mainloop() # <------------- mainloop aqui tambem
from tkinter import * from gui7 import HelloPackage frm = Frame() frm.pack() Label(frm, text='Hello').pack() part = HelloPackage(frm) part.pack( side=RIGHT ) # fail -- need part.top.pack(side=RIGHT); use 'from gui7c import HelloPackage' instead frm.mainloop()
from tkinter import * from gui7 import HelloPackage frm = Frame() frm.pack() Label(frm, text='hello').pack() part = HelloPackage(frm) part.pack(side=RIGHT) frm.mainloop()
from Tkinter import * from gui7 import HelloPackage # or get from gui7c--__getattr__ added frm = Frame() frm.pack() Label(frm, text='hello').pack() part = HelloPackage(frm) part.pack(side=RIGHT) # fails!--need part.top.pack(side=RIGHT) frm.mainloop()
# e.g. 7-25 from tkinter import * from gui7 import HelloPackage frm = Frame() frm.pack() Label(frm, text='hello').pack() part = HelloPackage(frm) part.top.pack(side=RIGHT) frm.mainloop()