あるケミストの独り言(winchemwinの日記)

ケミスト(化学者)の視点で、面白そうな情報(シミュレーション関係など)を発信

分子軌道情報(HOMO/LUMO)自動算出アプリ(CustumTkinter) その6

 前回に引き続きCustumTkinterを利用した軌道情報の自動計算アプリの紹介です。
今回もCustumTkinter関連のコードの設定コードの紹介の続きです。
計算手法のoption設定の表示ですが、数値入力がメインですのてtextBoxのウィジェットを使用しています。このウィジェットも基本的にはtkinterと同様の設定で利用できますので、それぞれ、スレッド数、メモリ、電荷、多重度、さらには表示させるHOMO/LUMOレベルの入力のウィジェットを設置しています。
 
 後はプログラム終了用にQuitのボタンのウィジェットを右下に設置しています。

# Select options
Label4=ctk.CTkLabel(master=root, text='Options', font=("Times",14,"bold"))
Label4.place(x=70, y=180)

Label4_1=ctk.CTkLabel(master=root, text='Tread',font=("Times",12))
Label4_1.place(x=80, y=200)
threads=tk.IntVar(value=2)
textBox1_1=ctk.CTkEntry(master=root, width=50, textvariable=threads)
textBox1_1.place(x=80, y=220)

Label4_2=ctk.CTkLabel(master=root, text='Memory/MB',font=("Times",12))
Label4_2.place(x=180, y=200)
memory=tk.IntVar(value=500)
textBox1_2=ctk.CTkEntry(master=root, width=50, textvariable=memory)
textBox1_2.place(x=180, y=220)

Label4_3=ctk.CTkLabel(master=root, text='Charge',font=("Times",12))
Label4_3.place(x=80, y=250)
charge=tk.IntVar(value=0)
textBox2_1=ctk.CTkEntry(master=root, width=50, textvariable=charge)
textBox2_1.place(x=80, y=270)

Label4_4=ctk.CTkLabel(master=root, text='Multiplicity',font=("Times",12))
Label4_4.place(x=180, y=250)
multi=tk.IntVar(value=1)
textBox2_2=ctk.CTkEntry(master=root, width=50, textvariable=multi)
textBox2_2.place(x=180, y=270)


# select HOMO/LUMO level

Label5=ctk.CTkLabel(master=root, fg_color='blue',corner_radius=10, text='HOMO/LUMO Level', font=("Arial",14,"bold","italic"))
Label5.place(x=400, y=100)

Label5_1=ctk.CTkLabel(master=root, text='Orbital level',font=("Times",12))
Label5_1.place(x=420, y=130)
orb_input=tk.IntVar(value=5)
textBox5_1=ctk.CTkEntry(master=root, width=50, textvariable=orb_input)
textBox5_1.place(x=420, y=150)


# Finish program
Label6=ctk.CTkLabel(master=root, text='Finish the program')
Label6.place(x=550, y=370)
Button3 = ctk.CTkButton(master=root, text='Quit',width=30, command=scry_finish,font=("Times",14,"bold"))
Button3.place(x=550, y=390)


root.mainloop()

 今回は短いですが、以上になります。次回はこのアプリの使用方法などについて紹介したいと思います。