Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple listbox for customtkinter (extenstion/add-on)

License

NotificationsYou must be signed in to change notification settings

Akascape/CTkListbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is alistbox widget for customtkinter, works just like the tkinter listbox.

Screenshot

Installation

pip install CTkListbox

GitHub repo size

Usage

importcustomtkinterfromCTkListboximport*defshow_value(selected_option):print(selected_option)root=customtkinter.CTk()listbox=CTkListbox(root,command=show_value)listbox.pack(fill="both",expand=True,padx=10,pady=10)listbox.insert(0,"Option 0")listbox.insert(1,"Option 1")listbox.insert(2,"Option 2")listbox.insert(3,"Option 3")listbox.insert(4,"Option 4")listbox.insert(5,"Option 5")listbox.insert(6,"Option 6")listbox.insert(7,"Option 7")listbox.insert("END","Option 8")root.mainloop()

Arguments

ParameterDescription
masterparent widget
widthoptional, set width of the listbox
heightoptional, set height of the listbox
fg_colorforeground color of the listbox
border_colorborder color of the listbox frame
border_widthwidth of the border frame
text_colorset the color of the option text
hoverEnable/Disable hover effect (bool)
hover_colorset hover color of the options
button_colorset color of unselected buttons
highlight_colorset the selected color of the option
fontset font of the option text, must be a tuple or CTkFont
wraplengthchange the number of letter per option line
justifychange the text anchor; left, right or center
commandcalls a command when a option is selected
multiple_selectionselect multiple options in the listbox,default=False
listvariableuse a tkinter variable to change the listbox content
*other_parametersall other parameters of ctk_scrollable frame can be passed

Methods

  • .insert(index, option)add new option to the listbox
  • .get()get the selected option(s)
  • .delete(index)delete any option from the listbox..delete("all") deletes all options
  • .size()get the size of the listbox
  • .activate(index)activate any option
  • .deactivate(index)deactivate any option
  • .curselection()returns indexes of selected options
  • .configure()change some parameters for the listbox.
  • .see(index)move the listbox scrollbar to the index place
  • .move_up(index)/.move_down(index)Reorder options in the listbox

Thanks for visiting! Hope it will help :)


[8]ページ先頭

©2009-2025 Movatter.jp