I’m having issues with redrawing the figure here. I allow the user to specify the units in the time scale (x-axis) and then I recalculate and call this function plots(). I want the plot to simply update, not append another plot to the figure. Answer You essentially have two options: Do exactly what you’re currently doing, but call graph1.clear() and
Tag: tkinter
Tkinter: Mouse drag a window without borders, eg. overridedirect(1)
Any suggestions on how one might create event bindings that would allow a user to mouse drag a window without borders, eg. a window created with overridedirect(1)? Use case: We would like to create a floating toolbar/palette window (without borders) that our users can drag around on their desktop. Here’s where I’m at in my thinking (pseudo code): window.bind( ‘<Button-1>’,
Is there a way to make the Tkinter text widget read only?
It doesn’t look like it has that attribute, but it’d be really useful to me. Answer You have to change the state of the Text widget from NORMAL to DISABLED after entering text.insert() or text.bind() :
How do I make Python remember settings?
I wrote the beautiful python example code below. Now how do I make it so when I exit then restart the program it remembers the last position of the scale? Edit: I tried the following code But get the following error Answer Write the scale value to a file and read it in on startup. Here’s one way to do
How to clear the Entry widget after a button is pressed in Tkinter?
I’m trying to clear the Entry widget after the user presses a button using Tkinter. I tried using ent.delete(0, END), but I got an error saying that strings don’t have the attribute delete. Here is my code, where I’m getting error on real.delete(0, END): Answer After poking around a bit through the Introduction to Tkinter, I came up with the
ttk.Button returns None [duplicate]
This question already has answers here: Tkinter: AttributeError: NoneType object has no attribute <attribute name> (4 answers) Closed 8 months ago. I am trying to use the invoke method of a ttk.Button, as shown at TkDocs (look at “The Command Callback”), but I keep getting this error: AttributeError: ‘NoneType’ object has no attribute ‘invoke’ So, I tried this in the
How to make a Tkinter window jump to the front?
How do I get a Tkinter application to jump to the front? Currently, the window appears behind all my other windows and doesn’t get focus. Is there some method I should be calling? Answer Assuming you mean your application windows when you say “my other windows”, you can use the lift() method on a Toplevel or Tk: If you want