{"id":1283,"date":"2020-11-26T09:35:39","date_gmt":"2020-11-26T09:35:39","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=1283"},"modified":"2022-08-05T12:24:12","modified_gmt":"2022-08-05T12:24:12","slug":"tkinter-combobox","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-combobox\/","title":{"rendered":"Tkinter Combobox"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn to create a Tkinter combobox widget that allows users to select one value from a set of values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-tkinter-combobox-widget'>Introduction to the Tkinter Combobox widget <a href=\"#introduction-to-the-tkinter-combobox-widget\" class=\"anchor\" id=\"introduction-to-the-tkinter-combobox-widget\" title=\"Anchor for Introduction to the Tkinter Combobox widget\">#<\/a><\/h2>\n\n\n\n<p>A combobox is a combination of an <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-entry\/\">Entry<\/a> widget and a <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-listbox\/\">Listbox<\/a> widget. A combobox widget allows you to select one value in a set of values. In addition, it allows you to enter a custom value.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='create-a-combobox'>Create a combobox <a href=\"#create-a-combobox\" class=\"anchor\" id=\"create-a-combobox\" title=\"Anchor for Create a combobox\">#<\/a><\/h3>\n\n\n\n<p>To create a combobox widget, you&#8217;ll use the <code>ttk.Combobox()<\/code> constructor. The following example creates a combobox widget and links it to a <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-stringvar\/\">string variable<\/a>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current_var = tk.StringVar()\ncombobox = ttk.Combobox(container, textvariable=current_var)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>container<\/code> is the <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-window\/\">window<\/a> or <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-frame\/\">frame<\/a> on which you want to place the combobox widget.<\/p>\n\n\n\n<p>The <code>textvariable<\/code> argument links a variable <code>current_var<\/code> to the current value of the combobox. <\/p>\n\n\n\n<p>To get the currently selected value, you can use the current_var variable: <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current_value = current_var.get()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Alternatively, you can use the <code>get()<\/code> method of the combobox object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current_value = combobox.get()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To set the current value, you use the current_var variable or  the <code>set()<\/code> method of the combobox object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current_value.set(new_value)\ncombobox.set(new_value)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='define-value-list'>Define value list <a href=\"#define-value-list\" class=\"anchor\" id=\"define-value-list\" title=\"Anchor for Define value list\">#<\/a><\/h3>\n\n\n\n<p>The combobox has the <code>values<\/code> property that you can assign a list of values to it like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">combobox&#91;<span class=\"hljs-string\">'values'<\/span>] = (<span class=\"hljs-string\">'value1'<\/span>, <span class=\"hljs-string\">'value2'<\/span>, <span class=\"hljs-string\">'value3'<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>By default, you can enter a custom value in the combobox. If you don&#8217;t want this, you can set the <code>state<\/code> option to <code>'readonly'<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">combobox&#91;<span class=\"hljs-string\">'state'<\/span>] = <span class=\"hljs-string\">'readonly'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To re-enable editing the combobox, you use the <code>'normal'<\/code> state like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">combobox&#91;<span class=\"hljs-string\">'state'<\/span>] = <span class=\"hljs-string\">'normal'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='bind-events'>Bind events <a href=\"#bind-events\" class=\"anchor\" id=\"bind-events\" title=\"Anchor for Bind events\">#<\/a><\/h3>\n\n\n\n<p>When a select value changes, the combobox widget generates a <code>'&lt;&lt;ComboboxSelected&gt;&gt;'<\/code> virtual event. To handle the event, you can use the bind() method like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">combobox.bind(<span class=\"hljs-string\">'&lt;&lt;ComboboxSelected&gt;&gt;'<\/span>, callback)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the callback function will execute when the selected value of the combobox changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='set-the-current-value'>Set the current value <a href=\"#set-the-current-value\" class=\"anchor\" id=\"set-the-current-value\" title=\"Anchor for Set the current value\">#<\/a><\/h3>\n\n\n\n<p>To set the current value, you use the <code>set()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">combobox.set(self, value)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Also, you can use the <code>current()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current(self, newindex=<span class=\"hljs-literal\">None<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>newindex<\/code> specifies the index of values from the list that you want to select as the current value.<\/p>\n\n\n\n<p>If you don&#8217;t specify the <code>newindex<\/code>, the <code>current()<\/code> method will return the index of the current value in the list of values or <code>-1<\/code> if the current value doesn&#8217;t appear in the list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='python-tkinter-combobox-example'>Python Tkinter combobox example <a href=\"#python-tkinter-combobox-example\" class=\"anchor\" id=\"python-tkinter-combobox-example\" title=\"Anchor for Python Tkinter combobox example\">#<\/a><\/h2>\n\n\n\n<p>The following program illustrates how to create a combobox widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> tkinter <span class=\"hljs-keyword\">as<\/span> tk\n<span class=\"hljs-keyword\">from<\/span> tkinter <span class=\"hljs-keyword\">import<\/span> ttk\n<span class=\"hljs-keyword\">from<\/span> tkinter.messagebox <span class=\"hljs-keyword\">import<\/span> showinfo\n<span class=\"hljs-keyword\">from<\/span> calendar <span class=\"hljs-keyword\">import<\/span> month_name\n\nroot = tk.Tk()\n\n<span class=\"hljs-comment\"># config the root window<\/span>\nroot.geometry(<span class=\"hljs-string\">'300x200'<\/span>)\nroot.resizable(<span class=\"hljs-literal\">False<\/span>, <span class=\"hljs-literal\">False<\/span>)\nroot.title(<span class=\"hljs-string\">'Combobox Widget'<\/span>)\n\n<span class=\"hljs-comment\"># label<\/span>\nlabel = ttk.Label(text=<span class=\"hljs-string\">\"Please select a month:\"<\/span>)\nlabel.pack(fill=tk.X, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">5<\/span>)\n\n<span class=\"hljs-comment\"># create a combobox<\/span>\nselected_month = tk.StringVar()\nmonth_cb = ttk.Combobox(root, textvariable=selected_month)\n\n<span class=\"hljs-comment\"># get first 3 letters of every month name<\/span>\nmonth_cb&#91;<span class=\"hljs-string\">'values'<\/span>] = &#91;month_name&#91;m]&#91;<span class=\"hljs-number\">0<\/span>:<span class=\"hljs-number\">3<\/span>] <span class=\"hljs-keyword\">for<\/span> m <span class=\"hljs-keyword\">in<\/span> range(<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">13<\/span>)]\n\n<span class=\"hljs-comment\"># prevent typing a value<\/span>\nmonth_cb&#91;<span class=\"hljs-string\">'state'<\/span>] = <span class=\"hljs-string\">'readonly'<\/span>\n\n<span class=\"hljs-comment\"># place the widget<\/span>\nmonth_cb.pack(fill=tk.X, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">5<\/span>)\n\n\n<span class=\"hljs-comment\"># bind the selected value changes<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">month_changed<\/span><span class=\"hljs-params\">(event)<\/span>:<\/span>\n    <span class=\"hljs-string\">\"\"\" handle the month changed event \"\"\"<\/span>\n    showinfo(\n        title=<span class=\"hljs-string\">'Result'<\/span>,\n        message=<span class=\"hljs-string\">f'You selected <span class=\"hljs-subst\">{selected_month.get()}<\/span>!'<\/span>\n    )\n\nmonth_cb.bind(<span class=\"hljs-string\">'&lt;&lt;ComboboxSelected&gt;&gt;'<\/span>, month_changed)\n\nroot.mainloop()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"366\" height=\"273\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2020\/11\/Tkinter-Combobox.png\" alt=\"\" class=\"wp-image-1284\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2020\/11\/Tkinter-Combobox.png 366w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2020\/11\/Tkinter-Combobox-300x224.png 300w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/figure>\n<\/div>\n\n\n<p>The following program shows the same month combobox widget and uses the set() method to set the current value to the current month:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> tkinter <span class=\"hljs-keyword\">as<\/span> tk\n<span class=\"hljs-keyword\">from<\/span> tkinter <span class=\"hljs-keyword\">import<\/span> ttk\n<span class=\"hljs-keyword\">from<\/span> tkinter.messagebox <span class=\"hljs-keyword\">import<\/span> showinfo\n<span class=\"hljs-keyword\">from<\/span> calendar <span class=\"hljs-keyword\">import<\/span> month_name\n<span class=\"hljs-keyword\">from<\/span> datetime <span class=\"hljs-keyword\">import<\/span> datetime\n\nroot = tk.Tk()\n\n<span class=\"hljs-comment\"># config the root window<\/span>\nroot.geometry(<span class=\"hljs-string\">'300x200'<\/span>)\nroot.resizable(<span class=\"hljs-literal\">False<\/span>, <span class=\"hljs-literal\">False<\/span>)\nroot.title(<span class=\"hljs-string\">'Combobox Widget'<\/span>)\n\n<span class=\"hljs-comment\"># label<\/span>\nlabel = ttk.Label(text=<span class=\"hljs-string\">\"Please select a month:\"<\/span>)\nlabel.pack(fill=tk.X, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">5<\/span>)\n\n<span class=\"hljs-comment\"># create a combobox<\/span>\nselected_month = tk.StringVar()\nmonth_cb = ttk.Combobox(root, textvariable=selected_month)\n\n<span class=\"hljs-comment\"># get first 3 letters of every month name<\/span>\nmonth_cb&#91;<span class=\"hljs-string\">'values'<\/span>] = &#91;month_name&#91;m]&#91;<span class=\"hljs-number\">0<\/span>:<span class=\"hljs-number\">3<\/span>] <span class=\"hljs-keyword\">for<\/span> m <span class=\"hljs-keyword\">in<\/span> range(<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">13<\/span>)]\n\n<span class=\"hljs-comment\"># prevent typing a value<\/span>\nmonth_cb&#91;<span class=\"hljs-string\">'state'<\/span>] = <span class=\"hljs-string\">'readonly'<\/span>\n\n<span class=\"hljs-comment\"># place the widget<\/span>\nmonth_cb.pack(fill=tk.X, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">5<\/span>)\n\n\n<span class=\"hljs-comment\"># bind the selected value changes<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">month_changed<\/span><span class=\"hljs-params\">(event)<\/span>:<\/span>\n    <span class=\"hljs-string\">\"\"\" handle the month changed event \"\"\"<\/span>\n    showinfo(\n        title=<span class=\"hljs-string\">'Result'<\/span>,\n        message=<span class=\"hljs-string\">f'You selected <span class=\"hljs-subst\">{selected_month.get()}<\/span>!'<\/span>\n    )\n\n\nmonth_cb.bind(<span class=\"hljs-string\">'&lt;&lt;ComboboxSelected&gt;&gt;'<\/span>, month_changed)\n\n<span class=\"hljs-comment\"># set the current month<\/span>\ncurrent_month = datetime.now().strftime(<span class=\"hljs-string\">'%b'<\/span>)\nmonth_cb.set(current_month)\n\nroot.mainloop()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use <code>ttk.Combobox(root, textvariable)<\/code> to create a combobox.<\/li><li>Set the <code>state<\/code> property to <code>readonly<\/code> to prevent users from entering custom values.<\/li><li>A combobox widget emits the <code>'&lt;&lt;ComboboxSelected&gt;&gt;'<\/code> event when the selected value changes.<\/li><\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1283\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-combobox\/\"\n\t\t\t\tdata-post-title=\"Tkinter Combobox\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1283\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-combobox\/\"\n\t\t\t\tdata-post-title=\"Tkinter Combobox\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn to create a Tkinter combobox widget that allows users to select one value from a set of values.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1232,"menu_order":20,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1283","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/1283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=1283"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/1283\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/1232"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}