Questions tagged [tkinter.checkbutton]

69 questions
1
vote
0 answers

How to check the state (enabled/disabled) of a checkbox in python (tkinter)

I have a program I am writing in Python and I'm having trouble with checking the state of a checkbox. I do NOT want to check whether it is checked or unchecked, but rather if it is disabled or enabled. As a background, I have numerous checkboxes…
Jordan Hawkes
  • 75
  • 1
  • 10
0
votes
0 answers

Python - Checkbutton background colour changes between on and off

When using images to replace the standard checkbutton(cb) box, the cb background is set to 'lightpurple' and is the colour when the cb is set to 'on'. When the cb is then selected, cb changes to 'off' but the cb colour becomes 'white (clear)' rather…
slv026
  • 1
  • 1
0
votes
0 answers

Onvalue of Checkbutton always = 0 python I also use get()

I had two codes, since I combined them, chechbox always = 0 (When I run the code separately, it works fine) from tkinter import * from tkinter import messagebox from tkinter import ttk from convert_number2text import convert_ordinary from pyperclip…
gamerfan82
  • 33
  • 5
0
votes
1 answer

Align text with checkbox in tkinter

I'm trying to align the text with the checkboxes. Reading from a list in a text file but only the last checkbox align with the text. import tkinter as tk root = tk.Tk() root.geometry("200x300") root.title("Test") with open("test.txt", "r") as…
Jonken
  • 3
  • 2
0
votes
0 answers

Can CheckboxTreeView create horizontal CheckButtons?

I am trying to use CheckboxTreeView from ttkWidgets and so far I am able to create Checkbuttons using the insert command. However, the number of check buttons are pretty lengthy (got about 30 of them ). I would like to have them horizontally stacked…
0
votes
1 answer

tkinter. checkbutton. How to understand what the user has chosen?

What should I do if the further development of my program depends on the selected "Checkbutton" ? What condition should I write down so that it is ahead of which Checkbutton the user clicked on?? c1 = IntVar() c2 = IntVar() c3 = IntVar() c4 =…
0
votes
1 answer

Python-3 Tkinter checkbuttons in different classes activated together

It happened with checkbuttons in different clases. It can be seen by running this code and clicking in any checkbutton: from tkinter import * import constant class Frame1(Frame): def __init__(self, parent): Frame.__init__(self,…
mathengineer
  • 140
  • 6
0
votes
0 answers

Tkinter Checkbutton: Initialing list of Checkbuttons with the "command" attribute - the command always refers to the last button

The program shows about 100 graphs I want to let the user the option to choose which graphs he wants to see, so there will be less graphs to present. For this purpose, I thought to use checkboxes. The problem is that whenever a checkbox is selected,…
Dorin
  • 1
  • 1
0
votes
1 answer

Checkbutton does not work in tkinter python - Tkinter, checkbuttons, python

I use tkinter as an interface to update dataframe. I did not want to use treeview because I liked using grid better. If you toggle the checkbutton it changes its value accordingly (0 - not selected, 1 - selected) In order to get the values for df I…
0
votes
1 answer

How to create a reset button to uncheck all radio and check buttons?

I am writing a code and I need to create a reset button to uncheck all radio buttons and checkbuttons, i keep on getting this error; AttributeError: 'IntVar' object has no attribute 'delete' here is the code i used in creating the reset button: def…
0
votes
1 answer

Python tkinter. Selected checkbuttons to list

I faced an issue and google did not give me an answer, so I am here. My program has a list and converts it into checkbottons. Now I want to get the selected items to work with them. Here is the code: import tkinter from tkinter import * mylist =…
TeaPot
  • 3
  • 1
0
votes
1 answer

When you press the Checkbutton, i want the name to be printed out

When you press the Checkbutton, i want the name to be printed out. Please help me find a solution of the problem, thanks. from tkinter import * def on_click(): lst = [interests[i] for i, chk in enumerate(chks) if chk.get()] print(lst) …
HOW TO
  • 5
  • 2
0
votes
1 answer

How to create a button to select all checkbuttons?

I want to create a list of checkboxes in Python with TkInter and try to select all checkboxes with a button. Help me find a solution to my problem, I've wasted a lot of time on it. from tkinter import * def on_click(): lst = [interests[i] for…
HOW TO
  • 5
  • 2
0
votes
1 answer

Python tkinter How can I created all these Checkbuttons by using a loop?

Is there any way to create all these Checkbuttons "grp_material_1", "grp_material_2","grp_material_..." by using a loop ? I try but got an error that the name ("grp_material_1", "grp_material_2"...) can not be a variable. I would like to reduce my…
Meriole
  • 127
  • 8
0
votes
2 answers

How to align Tkinter Checkbutton left when using sticky="EW"?

I want to align dynamically created Tkinter Checkbuttons to left while having widgets added by grid with sticky="EW" at the same time. I also want to display a background color. Here is code and example of such case but where widgets are not aligned…
Heikki
  • 341
  • 2
  • 18