![Python GUI Programming Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/163/36701163/b_36701163.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
We insert another column between the Entry widget and the Button widget using the grid layout manager. Here is the Python code:
GUI_combobox_widget.py
![](https://epubservercos.yuewen.com/A95289/19470408908965106/epubprivate/OEBPS/Images/Code_GUI_combobox_widget.png?sign=1739295092-A0ZJwXw3gifucz9MsHRVt7hcseJxxNA8-0-5a8218f1a9e3d8a4b50b550c7e30e607)
This code, when added to the previous recipes, creates the following GUI. Note how, in line 43 in the preceding code, we assigned a tuple with default values to the combo box. These values then appear in the drop-down box. We can also change them if we like (by typing in different values when the application is running):
![](https://epubservercos.yuewen.com/A95289/19470408908965106/epubprivate/OEBPS/Images/GUI_combobox_widget.png?sign=1739295092-UO4oXViGakCFOVxpRSpu3RTQbivZ6hbb-0-6ad7e675dddd75696c8a677aaa100c47)