Skip to content
Advertisement

Tag: tkinter

How to draw lines between widgets in Tkinter?

I have written a script that takes in a file of the format Where each line in the list represents a ‘parent’ node and its list of ‘child’ nodes. So far I have written a script such that these nodes are printed out like a tree, and now I want to try to draw lines/arrows between these nodes. My current

tkinter: Disable the focus on each widget

With tkinter you can deactivate the focus of a single widget Is it also possible to disable this for all widgets at once? Edit: By “all” I mean all tk and ttk widgets present in the window. Answer takefocus is a standard option in tkinter and ttk. So all you have to do is to recursively loop over the widgets

Get values from checkboxes in Tkinter

I have a list of multiple strings. I want the user to choose one or more of these strings through a GUI interface. For example, if my list is l = [“apple”, “ball”, “cat”, “dog”], I want the GUI to show I also want to read the inputs given by the user. How can I generate checkboxes for each of

How can I make the tkinter window fixed?

This is my current code, and I am struggling to understand where I need to put additional code to make sure that my tkinter window is fixed. Code taken from: https://pythonprogramming.net/change-show-new-frame-tkinter/ Answer As mentioned in the comments, you simply need to set your root window resizable method to false. In your case it is the SeaofBTCapp class. For Example:

My second StringVar fails to show text, shows blank

I was writing a pixel editor in Tkinter, to practice Tkinter and GUI programming. And I was thinking to add a “bottom frame” to show informations like the current tool, the canvas size, etc. But for some reason, the second defined StringVar doesn’t seems to work, while the first one works just fine. By this, I mean the code runs

How do I get text to be centered in a Tkinter Canvas?

I am making Checkers and am using an asterisk to mark the kings. I need the asterisk to be centered in the middle of the canvas. I made this example to show what’s going wrong: The asterisk looks like it’s centered on the horizantal axis, but it is too high on the vertical one. I’m placing it at (50,50), since

Scroll bars not working correctly with canvas

The scroll bars move the canvas but they always snap back to the top or the left. What am I doing wrong? Answer Scrollbars require two-way communication with the widgets they are controlling. You’ve properly configured the scrollbars but haven’t configured the canvas to update the scrollbars. To do that, add the following code after you’ve defined the canvas and

How to remove scale value from tkinter Scale widget display?

I am trying to use a tkinter Scale widget in an application and whenever I set the tickinterval attribute, a value is displayed below the slider. Is there a way to suppress the display of scale values below the slider and still specify the tickinterval? My use case is to create a non-linear slider where scale values 0-6 map to

Advertisement