Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
Python Tkinter CheckbuttonPython Tkinter Checkbutton

Python Tkinter Checkbutton – A Complete Guide

Posted on March 17, 2025March 17, 2025 By Rishabh saini No Comments on Python Tkinter Checkbutton – A Complete Guide

Python Tkinter Checkbutton

In GUI applications, user input plays a crucial role, and Tkinter, the standard GUI toolkit in Python, offers various widgets to handle such interactions. One such essential widget is the Checkbutton. The Checkbutton allows users to make multiple selections from a given set of choices. It provides an intuitive on/off switch, making it useful for forms, settings, and preference-based applications.

Complete Python Course with Advance topics:-Click here

What is a Tkinter Checkbutton?

A Checkbutton is a type of button that allows users to select multiple options from a list. It acts as a toggle switch where users can check or uncheck a particular choice. The Checkbutton can display both text and images, making it versatile for different UI needs.

Syntax of Checkbutton

w = Checkbutton(master, options)

Here, master is the parent widget (like a Tkinter window or frame), and options are various attributes to customize the Checkbutton.

Tkinter Checkbutton Options

The table below describes the various configuration options available for the Checkbutton widget:

SNOptionDescription
1activebackgroundBackground color when the Checkbutton is hovered.
2activeforegroundForeground (text) color when hovered.
3bgBackground color of the Checkbutton.
4bitmapDisplays a monochrome image on the Checkbutton.
5bdSets the border size of the Checkbutton.
6commandAssociates a function to be executed when the Checkbutton state changes.
7cursorChanges the mouse cursor when hovering over the Checkbutton.
8disableforegroundColor of the text when the Checkbutton is disabled.
9fontSets the font style of the Checkbutton.
10fgForeground (text) color of the Checkbutton.
11heightSpecifies the height of the Checkbutton. Default is 1.
12highlightcolorColor of the focus highlight when the Checkbutton is selected.
13imageDisplays an image on the Checkbutton.
14justifyAligns text when multiline text is used.
15offvalueValue assigned when the Checkbutton is unchecked (default: 0).
16onvalueValue assigned when the Checkbutton is checked (default: 1).
17padxHorizontal padding inside the Checkbutton.
18padyVertical padding inside the Checkbutton.
19reliefBorder style of the Checkbutton (default: FLAT).
20selectcolorColor of the Checkbutton when selected (default: red).
21selectimageDisplays a different image when the Checkbutton is selected.
22stateState of the Checkbutton (NORMAL, DISABLED, ACTIVE).
23underlineUnderlines a specific character in the Checkbutton label.
24variableLinks the Checkbutton to a Tkinter variable.
25widthSpecifies the width of the Checkbutton in characters.
26wraplengthWraps text into multiple lines at a specified width.

Tkinter Checkbutton Methods

Below are the common methods available for the Checkbutton widget:

SNMethodDescription
1deselect()Unchecks the Checkbutton.
2flash()Flashes between active and normal colors.
3invoke()Calls the function associated with the Checkbutton.
4select()Checks the Checkbutton.
5toggle()Toggles the Checkbutton state (checked/unchecked).

Example: Creating Checkbuttons in Tkinter

Here’s a simple example demonstrating how to create multiple Checkbuttons in a Tkinter window:

from tkinter import *

# Create main window
top = Tk()
top.geometry("250x200")

title_label = Label(top, text="Select Your Preferred Languages:", font=("Arial", 10, "bold"))
title_label.pack()

# Define Tkinter variables
checkvar1 = IntVar()
checkvar2 = IntVar()
checkvar3 = IntVar()

# Creating Checkbuttons
chkbtn1 = Checkbutton(top, text="Python", variable=checkvar1, onvalue=1, offvalue=0, height=2, width=10)
chkbtn2 = Checkbutton(top, text="Java", variable=checkvar2, onvalue=1, offvalue=0, height=2, width=10)
chkbtn3 = Checkbutton(top, text="C++", variable=checkvar3, onvalue=1, offvalue=0, height=2, width=10)

chkbtn1.pack()
chkbtn2.pack()
chkbtn3.pack()

# Run main event loop
top.mainloop()

Output:

This will create a simple GUI with three checkboxes labeled Python, Java, and C++, allowing users to select multiple options.

Download New Real Time Projects :-Click here
Complete Advance AI topics:- CLICK HERE

Conclusion

The Checkbutton widget in Tkinter is a powerful component for handling multiple-choice selections in Python GUI applications. It supports various configurations and methods to customize user interactions effectively. Whether used in forms, settings, or user preferences, the Checkbutton provides a seamless experience for capturing user input.

For more Python GUI tutorials and advanced Tkinter projects, stay tuned to UpdateGadh!


python tkinter checkbutton example
python tkinter checkbutton get value
python tkinter checkbutton tutorial
tkinter checkbutton set value
tkinter checkbutton command
tkinter checkbutton state
tkinter checkbutton select
tkinter checkbutton default value
python tkinter checkbutton
python tkinter checkbutton default checked
python tkinter checkbutton get value
python tkinter checkbutton example
python tkinter checkbutton command
python tkinter checkbutton size
python tkinter checkbutton disable

    Post Views: 622
    SQL Tutorial Tags:checkbox python tkinter, checkbutton, checkbutton in python tkinter, checkbutton in tkinter, checkbutton in tkinter python, checkbutton tkinter, checkbutton tkinter python 3, checkbutton widget in python, how to python tkinter, Python, python checkbox tkinter, python checkbutton, python gui, python tkinter, python tkinter checkbox, python tkinter checkbutton, python tkinter tutorial, Tkinter, tkinter checkbutton, tkinter python

    Post navigation

    Previous Post: Calorie Tracker Using Python
    Next Post: Python Tkinter Entry Widget: A Comprehensive Guide

    More Related Articles

    SQL SELECT COUNT SQL SELECT COUNT: A Comprehensive Guide SQL Tutorial
    SQL Tutorial: A Comprehensive Guide - SQL Tutorial : updategadh.com SQL Tutorial: A Comprehensive Guide SQL Tutorial
    SQL vs NoSQL SQL vs NoSQL: A Detailed Comparison SQL Tutorial

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    You may also like

    1. Understanding the SQL DELETE Statement and Its Variants
    2. SQL Temporary Tables: A Handy Tool for Developers
    3. SQL SELECT TOP Clause: A Comprehensive Guide
    4. SQL ORDER BY LIMIT – Retrieve Specific Rows from a Database
    5. SQL FULL JOIN – A Complete Guide
    6. IN vs EXISTS in SQL: A Complete Guide

    Most Viewed Posts

    1. Top Large Language Models in 2025
    2. Online Shopping System using PHP, MySQL with Free Source Code
    3. login form in php and mysql , Step-by-Step with Free Source Code
    4. Flipkart Clone using PHP And MYSQL Free Source Code
    5. News Portal Project in PHP and MySql Free Source Code
    6. User Login & Registration System Using PHP and MySQL Free Code
    7. Top 10 Final Year Project Ideas in Python
    8. Online Bike Rental Management System Using PHP and MySQL
    9. E learning Website in php with Free source code
    10. E-Commerce Website Project in Java Servlets (JSP)
    • AI
    • ASP.NET
    • Blockchain
    • ChatCPT
    • code Snippets
    • Collage Projects
    • Data Science Project
    • Data Science Tutorial
    • DBMS Tutorial
    • Deep Learning Tutorial
    • Final Year Projects
    • Free Projects
    • How to
    • html
    • Interview Question
    • Java Notes
    • Java Project
    • Java Script Notes
    • JAVASCRIPT
    • Javascript Project
    • JSP JAVA(J2EE)
    • Machine Learning Project
    • Machine Learning Tutorial
    • MySQL Tutorial
    • Node.js Tutorial
    • PHP Project
    • Portfolio
    • Python
    • Python Interview Question
    • Python Projects
    • PythonFreeProject
    • React Free Project
    • React Projects
    • Spring boot
    • SQL Tutorial
    • TOP 10
    • Uncategorized
    • Online Examination System in PHP with Source Code
    • AI Chatbot for College and Hospital
    • Job Portal Web Application in PHP MySQL
    • Online Tutorial Portal Site in PHP MySQL — Full Project with Source Code
    • Online Job Portal System in JSP Servlet MySQL

    Most Viewed Posts

    • Top Large Language Models in 2025 (8,612)
    • Online Shopping System using PHP, MySQL with Free Source Code (5,209)
    • login form in php and mysql , Step-by-Step with Free Source Code (4,858)

    Copyright © 2026 UpdateGadh.

    Powered by PressBook Green WordPress theme