if response=="Yes":\r
base.destroy()\r
\r
+def create_label(welcomeText):\r
+ Bot_ko = customtkinter.CTkLabel(ChatLog,text=welcomeText+"\n", justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
+ WhiteSpace = customtkinter.CTkLabel(ChatLog,text="This is a empty line label", justify='left',text_color='#d3d3d3',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
+ ChatLog.insert('0.0', '\n')\r
+ ChatLog.window_create('0.0', window=WhiteSpace)\r
+ ChatLog.insert(END, '\n')\r
+ ChatLog.window_create('end', window=Bot_ko)\r
+ ChatLog.insert(END, '\n')\r
+ ChatLog.see("1.0")\r
+ ChatLog.tag_add("no_padding", "end-1c linestart", "end-1c lineend")\r
+ ChatLog.tag_configure("no_padding", lmargin1=0, lmargin2=0, rmargin=0)\r
+ ChatLog.insert(END, "")\r
+\r
def radiobutton_event():\r
global toggle\r
\r
- print("radiobutton toggled, current value:", radio_var.get())\r
- print("ChatLog.winfo_children()", ChatLog.winfo_children())\r
-\r
# get yes/no answers whether user want to change language or not\r
msg = CTkMessagebox(title="Exit?", message="Your current progress will be lost. Do you want to switch language?",\r
icon="question", option_1="No", option_2="Yes", option_3="",option_focus=2)\r
response = msg.get()\r
-\r
+ welcomeText = "Assistant: Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
if response=="Yes":\r
ChatLog.mark_set("end", "1.0")\r
if toggle != radio_var.get():\r
if child.widgetName == "frame":\r
child.destroy()\r
ChatLog.delete(0, END)\r
+ Bot.destroy()\r
if radio_var.get() == 2:\r
- Bot.destroy()\r
- welcomeText = "Assistant: Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
welcomeText = translate_to_ko(welcomeText)\r
- Bot_ko = customtkinter.CTkLabel(ChatLog,text=welcomeText+"\n\n", justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
- WhiteSpace = customtkinter.CTkLabel(ChatLog,text="This is a empty line label", justify='left',text_color='#d3d3d3',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
- ChatLog.insert('0.0', '\n')\r
- ChatLog.window_create('0.0', window=WhiteSpace)\r
- ChatLog.insert(END, '\n')\r
- ChatLog.window_create('end', window=Bot_ko)\r
- ChatLog.insert(END, '\n')\r
- ChatLog.see("1.0")\r
- ChatLog.tag_add("no_padding", "end-1c linestart", "end-1c lineend")\r
- ChatLog.tag_configure("no_padding", lmargin1=0, lmargin2=0, rmargin=0)\r
- ChatLog.insert(END, "")\r
+ create_label(welcomeText)\r
\r
elif radio_var.get() == 1:\r
- Bot.destroy()\r
- welcomeText = "Assistant: Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
- Bot_ko = customtkinter.CTkLabel(ChatLog,text=welcomeText+"\n", justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
- WhiteSpace = customtkinter.CTkLabel(ChatLog,text="This is a empty line label", justify='left',text_color='#d3d3d3',corner_radius=10, padx=10, pady=5, font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
- ChatLog.insert('0.0', '\n')\r
- ChatLog.window_create('0.0', window=WhiteSpace)\r
- ChatLog.insert(END, '\n')\r
- ChatLog.window_create('end', window=Bot_ko)\r
- ChatLog.insert(END, '\n')\r
- ChatLog.see("1.0")\r
- ChatLog.tag_add("no_padding", "end-1c linestart", "end-1c lineend")\r
- ChatLog.tag_configure("no_padding", lmargin1=0, lmargin2=0, rmargin=0)\r
- ChatLog.insert(END, "")\r
+ create_label(welcomeText)\r
+\r
toggle = radio_var.get()\r
return radio_var.get()\r
else:\r