tkinter.Tkを継承するclassを作成する。 イニシャライザ第一引数にself、第二引数に可変長引数*args、 第三引数に可変長引数**kwargsを設定する。 class Application(tkinter.Tk): def __init__(self, *args, **kwargs): tkinter.Tk.__init__(self, *args, kwargs) ...
tkinter.ttkをimportする。 コンボボックスは tkinter.ttkのComboboxオブジェクトを ・第一引数に、フレームの変数 ・引数valuesに、リストの変数 他必要なオプション引数を設定し変数作成。 フレームへの配置は、place、grid、pack いずれかを使用する。
But suddenly, it’s all looking like spaghetti. Let me introduce you to your new best friend: Frame. It helps you keep your layout neat and organized—just like folders on your desktop.
y_scroll = tkinter.Scrollbar(frame1, orient=tkinter.VERTICAL, command=canvas.yview) #縦ならVERTICAL、横ならHORIZONTAL y_scroll.pack(side=tkinter.RIGHT, fill="y ...
#f1=Frame(root,width=300, height=800, bg="cyan",colormap="new") OR f1=Frame(root,bg="cyan",borderwidth=5,relief=SUNKEN) ...