{"id":1007,"date":"2021-07-09T10:30:48","date_gmt":"2021-07-09T10:30:48","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=1007"},"modified":"2021-07-09T10:30:48","modified_gmt":"2021-07-09T10:30:48","slug":"checkbutton","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/checkbutton\/","title":{"rendered":"Checkbutton"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u042d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<strong>Checkbutton<\/strong>&nbsp;\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u043b\u0430\u0436\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445: \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0438 \u043d\u0435\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0444\u043b\u0430\u0436\u043e\u043a:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<\/td><td><code><code>from<\/code> <code>tkinter import<\/code> <code>*<\/code><br>\u00a0<br><code>root =<\/code> <code>Tk()<\/code><br><code>root.title(\"GUI \u043d\u0430 Python\")<\/code><br><code>root.geometry(\"300x250\")<\/code><br>\u00a0<br><code>ismarried =<\/code> <code>IntVar()<\/code><br>\u00a0<br><code>ismarried_checkbutton =<\/code> <code>Checkbutton(text=\"\u0416\u0435\u043d\u0430\u0442\/\u0417\u0430\u043c\u0443\u0436\u0435\u043c\", variable=ismarried)<\/code><br><code>ismarried_checkbutton.pack()<\/code><br>\u00a0<br><code>ismarried_label =<\/code> <code>Label(textvariable=ismarried)<\/code><br><code>ismarried_label.place(relx=.5, rely=.5, anchor=\"c\")<\/code><br>\u00a0<br><code>root.mainloop()<\/code><\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0435\u0440\u0442\u043e\u0439 Checkbutton \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 IntVar \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440&nbsp;<strong>variable<\/strong>. \u0412 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 IntVar \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1, \u0430 \u0432 \u043d\u0435\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c &#8211; 0. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0447\u0435\u0440\u0435\u0437 IntVar \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/metanit.com\/python\/tutorial\/pics\/9.15.png\" alt=\"Checkbutton \u0432 tkinter \u0438 Python\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 Checkbutton \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u044f\u0434 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0436\u043a\u043e\u0432:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>Checkbutton(master, options)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 master \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043e\u043a\u043d\u043e, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 options \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>activebackground<\/strong>: \u0444\u043e\u043d\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u043b\u0430\u0436\u043a\u0430 \u0432 \u043d\u0430\u0436\u0430\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438<\/li><li><strong>activeforeground<\/strong>: \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0444\u043b\u0430\u0436\u043a\u0430 \u0432 \u043d\u0430\u0436\u0430\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438<\/li><li><strong>bg<\/strong>: \u0444\u043e\u043d\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>bitmap<\/strong>: \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>bd<\/strong>: \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>command<\/strong>: \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0444\u043b\u0430\u0436\u043e\u043a<\/li><li><strong>cursor<\/strong>: \u043a\u0443\u0440\u0441\u043e\u0440 \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/li><li><strong>disabledforeground<\/strong>: \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 DISABLED<\/li><li><strong>font<\/strong>: \u0448\u0440\u0438\u0444\u0442<\/li><li><strong>fg<\/strong>: \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430<\/li><li><strong>height<\/strong>: \u0432\u044b\u0441\u043e\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/li><li><strong>image<\/strong>: \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435<\/li><li><strong>justify<\/strong>: \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f CENTER, LEFT, RIGHT<\/li><li><strong>offvalue<\/strong>: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441 \u0444\u043b\u0430\u0436\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 IntVar \u0432 \u043d\u0435\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u043e 0<\/li><li><strong>onvalue<\/strong>: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441 \u0444\u043b\u0430\u0436\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 IntVar \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u043e 1<\/li><li><strong>padx<\/strong>: \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>pady<\/strong>: \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443 \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>relief<\/strong>: \u0441\u0442\u0438\u043b\u044c \u0444\u043b\u0430\u0436\u043a\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 FLAT<\/li><li><strong>selectcolor<\/strong>: \u0446\u0432\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u0430 \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>selectimage<\/strong>: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0444\u043b\u0430\u0436\u043a\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438<\/li><li><strong>state<\/strong>: \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f NORMAL (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e), DISABLED \u0438 ACTIVE<\/li><li><strong>text<\/strong>: \u0442\u0435\u043a\u0441\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/li><li><strong>underline<\/strong>: \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>variable<\/strong>: \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0442\u0438\u043f\u0430 IntVar, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0444\u043b\u0430\u0436\u043a\u0430<\/li><li><strong>width<\/strong>: \u0448\u0438\u0440\u0438\u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/li><li><strong>wraplength<\/strong>: \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<\/td><td><code><code>from<\/code> <code>tkinter import<\/code> <code>*<\/code><br>\u00a0<br><code>root =<\/code> <code>Tk()<\/code><br><code>root.title(\"GUI \u043d\u0430 Python\")<\/code><br><code>root.geometry(\"300x250\")<\/code><br>\u00a0<br><code>python_lang =<\/code> <code>IntVar()<\/code><br><code>python_checkbutton =<\/code> <code>Checkbutton(text=\"Python\", variable=python_lang,<\/code><br><code>onvalue=1, offvalue=0, padx=15, pady=10)<\/code><br><code>python_checkbutton.grid(row=0, column=0, sticky=W)<\/code><br>\u00a0<br><code>javascript_lang =<\/code> <code>IntVar()<\/code><br><code>javascript_checkbutton =<\/code> <code>Checkbutton(text=\"JavaScript\", variable=javascript_lang,<\/code><br><code>onvalue=1, offvalue=0, padx=15, pady=10)<\/code><br><code>javascript_checkbutton.grid(row=1, column=0, sticky=W)<\/code><br>\u00a0<br><code>root.mainloop()<\/code><\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/metanit.com\/python\/tutorial\/pics\/9.16.png\" alt=\"checkbox in tkinter and Python\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;Checkbutton&nbsp;\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u043b\u0430\u0436\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445: \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0438 \u043d\u0435\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0444\u043b\u0430\u0436\u043e\u043a: 123456789101112131415 from tkinter import *\u00a0root [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[76],"tags":[],"class_list":["post-1007","page","type-page","status-publish","hentry","category-rukovodstvo-po-yazyku-programmirovaniya-python"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/1007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=1007"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/1007\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=1007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=1007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=1007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}