tkinter

Tkinter - memory leak with canvas

冷暖自知 提交于 2021-01-28 12:53:07
问题 I have a Python script that handles Modbus communications. One feature I added was a "graph" that shows the response times along with a color coded line that indicates if the response was successful, had an exception, or an error. The graph is just a scrollable canvas widget from Tkinter. After graphing a certain number of lines old lines will be deleted and then a new one will be added to the end. For this example I have it set to 10, which means there will never be more than 10 lines on the

Tkinter - memory leak with canvas

柔情痞子 提交于 2021-01-28 12:53:00
问题 I have a Python script that handles Modbus communications. One feature I added was a "graph" that shows the response times along with a color coded line that indicates if the response was successful, had an exception, or an error. The graph is just a scrollable canvas widget from Tkinter. After graphing a certain number of lines old lines will be deleted and then a new one will be added to the end. For this example I have it set to 10, which means there will never be more than 10 lines on the

Tkinter - memory leak with canvas

放肆的年华 提交于 2021-01-28 12:52:39
问题 I have a Python script that handles Modbus communications. One feature I added was a "graph" that shows the response times along with a color coded line that indicates if the response was successful, had an exception, or an error. The graph is just a scrollable canvas widget from Tkinter. After graphing a certain number of lines old lines will be deleted and then a new one will be added to the end. For this example I have it set to 10, which means there will never be more than 10 lines on the

Trace Variable - ComboBox Tkinter

只愿长相守 提交于 2021-01-28 12:45:13
问题 I'm trying to trace a variable using a ComboBox Widget. When I change the ComboBox value I get the following error: AttributeError: 'StringVar' object has no attribute '_report_exception' What am I doing wrong? import tkinter as tk from tkinter import ttk, StringVar class TEST(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) self.parent = parent self.estvalue = StringVar() self.pestanas = ttk.Notebook(self.parent) self.geometria = ttk.Frame(self.pestanas) self.viento =

Trace Variable - ComboBox Tkinter

…衆ロ難τιáo~ 提交于 2021-01-28 12:44:58
问题 I'm trying to trace a variable using a ComboBox Widget. When I change the ComboBox value I get the following error: AttributeError: 'StringVar' object has no attribute '_report_exception' What am I doing wrong? import tkinter as tk from tkinter import ttk, StringVar class TEST(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) self.parent = parent self.estvalue = StringVar() self.pestanas = ttk.Notebook(self.parent) self.geometria = ttk.Frame(self.pestanas) self.viento =

Reading higher frequency data in thread and plotting graph in real-time with Tkinter

◇◆丶佛笑我妖孽 提交于 2021-01-28 12:25:19
问题 In the last couple of weeks, I've been trying to make an application that can read EEG data from OpenBCI Cyton (@250Hz) and plot a graph in 'real-time'. What seems to work better here are threads. I applied the tips I found here 1 to communicate the thread with Tkinter, but the application still doesn't work (gives me the error RecursionError: maximum recursion depth exceeded while calling a Python object ). Maybe I'm doing something wrong because I'm trying to use multiple .py files? See

Reading higher frequency data in thread and plotting graph in real-time with Tkinter

最后都变了- 提交于 2021-01-28 12:17:24
问题 In the last couple of weeks, I've been trying to make an application that can read EEG data from OpenBCI Cyton (@250Hz) and plot a graph in 'real-time'. What seems to work better here are threads. I applied the tips I found here 1 to communicate the thread with Tkinter, but the application still doesn't work (gives me the error RecursionError: maximum recursion depth exceeded while calling a Python object ). Maybe I'm doing something wrong because I'm trying to use multiple .py files? See

Add styles to headings (text bold and backgroundcolor) of a Treeview Table - Tkinter Python

非 Y 不嫁゛ 提交于 2021-01-28 11:50:43
问题 I have this little Tkinter GUI where I have a table. I want to make the text bold in the headings and also change its background color. I know that we can do this by ttk.Style() and configure but nothing is changing in the table. It's still looking plain or am I doing this wrong. Please help. from tkinter import ttk import tkinter as tk from tkinter import * window = tk.Tk() window.state('zoomed') treev = ttk.Treeview(window, selectmode ='browse') treev.place(x= 600, y= 200, width= 350,

Change colour of tkinter button created in a loop?

匆匆过客 提交于 2021-01-28 11:20:44
问题 I have created a grid of buttons using the code below: for x in range(10): for y in range(10): btn = Button(frame, command=button_click(x, y)) btn.config(height=1, width=1) btn.grid(column=x, row=y, sticky='nsew') and I want to write the function button_click to turn the button a different colour once it has been clicked but as I have created all the buttons in a loop I don't have a specific variable name for each button so I'm not sure how best to do it? I didn't want to write 100 lines of

Tkinter button different commands on right and left mouse click

青春壹個敷衍的年華 提交于 2021-01-28 11:12:18
问题 I am making minesweeper game in Python and use tkinter library to create gui. Is there any way to bind to tkinter Button two commands, one when button is right-clicked and another when it's left clicked? 回答1: Typically buttons are designed for single clicks only, though tkinter lets you add a binding for just about any event with any widget. If you're building a minesweeper game you probably don't want to use the Button widget since buttons have built-in behaviors you probably don't want.