Understanding Combo Boxes with Check Boxes (List Boxes)

Asked 2 years ago, Updated 2 years ago, 386 views

Is there a way to make something like this happen in my environment?(Is there anything other than tkinter?)

[.NET] How to select multiple items in the combo box

●About my environment
·Python 3.9.7
·tkinter'8.6.12'
·PyCharm 2021.3.3 (Community Edition)

Thank you for your cooperation.

python python3 tkinter tk

2022-09-30 22:04

1 Answers

https://github.com/hatfullr/ChecklistCombobox
However, if you do the following, you will be able to do the least.

Place 1.checklistcombobox.py where you can import within the project.

2. Configuration
# Import using from etc. as appropriate
import checklist combobox as CombChk

# Check box name (name per check box displayed in combo box)
lst_ChkboxLabel=['ChkBox1', 'ChkBox2', 'ChkBox3', 'ChkBox4', 'ChkBox5' ]


3. Class Definitions
class C_CHEFK_LIST_COMBO_BOC():

    # Initial Configuration
    def__init__(self):

        In #value=, when the above list is set, a check box is created according to the number of elements.
        # The placement and size are the same as the standard widget.
        self.CmbChk=CombChk.ChecklistCombobox (root, values=self.lst_ChkboxLabel, width=20, height=18)
        self.CmbChk.configure(checkbutton_height=1)# row height
        self.CmbChk.pack (side=tk.TOP)

    # Retrieving Values
    def Get_CmbChk_Status(self):
    
        chk_status=self.CmbChk.get()# Returns a list of the parts checked by the return value.


About chk_status.
    For example, in the lst_ChkboxLabel, ChkBox1', 'ChkBox3', 'ChkBox5 is checked.
    chk_status=['ChkBox1', 'ChkBox3', 'ChkBox5']
come to .


2022-09-30 22:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.