How to place a string value to a tkinter text box? String value comes from another function

60 Views Asked by At
def selection_changed(self,event):
    global change_val     
    selection = self.TCombobox1.get()
    get_sel_val = selection.split('=')
    cur_sel_val = get_sel_val[1]
    get_cur_val = selection.partition('=')[0] # Returns string 
    get_cur_val
    #print(cur_sel_val)
    change_val = get_cur_val
    #Configuring the text in Label widget   
    def update_text():  
        self.Label1_2.configure(text=cur_sel_val)
    update_text()                                              
    messagebox.showinfo(
        title="New Selection",       
        message=f"Selected option: {get_cur_val}")

    self.Label1_2 = tk.Label(self.Frame1_1)
    self.Label1_2.place(relx=0.179, rely=0.519, 
    relheight=0.326,relwidth=0.613)
    self.Label1_2.configure(activebackground="#d9d9d9")
    self.Label1_2.configure(borderwidth="5")
    self.Label1_2.configure(compound='center')
    self.Label1_2.configure(font="-family {DejaVu Sans} -size 10")
    self.Label1_2.configure(relief="groove")
    self.Label1_2.configure(text = get_new_val)
0

There are 0 best solutions below