Python Forum
textfile to customtkinter combobox
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
textfile to customtkinter combobox
#7
Read the documentation. Tots of examples. Light on text. CTkComboBox does not have a "current()" method for setting the value. Use .set().
https://customtkinter.tomschimansky.com/...s/combobox
import customtkinter as tk

with open(__file__, "r") as file:
    values = [x.strip() for x in file]
root = tk.CTk()
cbox = tk.CTkComboBox(root, values=values, font=(None, 16), width=600)
cbox.pack()
cbox.set(values[5])
root.mainloop()
Are you happy now? You made me install customtkinter.
Reply


Messages In This Thread
textfile to customtkinter combobox - by janeik - Aug-30-2023, 01:49 PM
RE: textfile to customtkinter combobox - by janeik - Aug-30-2023, 09:07 PM
RE: textfile to customtkinter combobox - by janeik - Aug-31-2023, 12:27 AM
RE: textfile to customtkinter combobox - by janeik - Aug-31-2023, 12:21 AM
RE: textfile to customtkinter combobox - by deanhystad - Aug-31-2023, 02:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Importing python data to Textfile or CSV yanDvator 0 1,821 Aug-02-2020, 06:58 AM
Last Post: yanDvator
  Replace Line in Textfile Deadline 1 10,479 Nov-04-2019, 07:14 PM
Last Post: Larz60+
  Compare input() to textfile Trianne 4 3,616 Sep-29-2018, 02:32 PM
Last Post: gruntfutuk
  Write from URL with changing information to textfile wmc326 1 3,067 Jul-12-2017, 07:10 PM
Last Post: wavic
  Loop thru textfile, change 3 variables for every line herbertioz 11 9,349 Nov-10-2016, 04:56 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020