提问人:stcnchenxin 提问时间:11/17/2023 最后编辑:stcnchenxin 更新时间:11/17/2023 访问量:40
tkinter 组合框的问题:如何设置一个值但显示另一个值 [已关闭]
Question of tkinter combobox: how to set a value but show another value [closed]
问:
from tkinter.ttk import Combobox
import tkinter as tk
root = tk.Tk()
values = ["info_1", "info_2"]
combobox = Combobox(root , values=values) # i hope it can show other text but hold value of variable [values]
combobox.pack()
root.mainloop()
我希望它可以通过一些设置来更改显示内容。与设置 1 一样,它显示 ;setting2 ,它显示等等。["info_1_setting1", "info_2_setting1"]
["info_1_setting2", "info_2_setting2"]
由于某种原因,我无法直接更改该值,这意味着我无法将该值设置为 。["info_1_setting1", "info_2_setting1"]
答: 暂无答案
评论