widget

How to center an image in the tkinter Text widget?

How to center an image in the tkinter Text widget? Question: A button on the main application opens a help file that is a text file imported from the file system. Before the text I want to display an image. This code places the image properly before the text BUT I can’t center it. Here’s …

Total answers: 1

Drag and drop files to QListWidget created with QT-Designer

Drag and drop files to QListWidget created with QT-Designer Question: i am trying to implement a drag and drop feature to PyQt5 QListWidget it works if self.acceptDrops(True) is in the code but it works on whole application window and wherever i drag file in the window it will add a file to QListWidget… My goal …

Total answers: 1

Adding different values ​to the entries created with the loop

Adding different values ​to the entries created with the loop Question: For example, I want to insert the numbers from 1 to 10, respectively, from the beginning to the end, into the 10 entries I created with a loop. from tkinter import * root = Tk() root.title("") root.geometry("500×400") canva = Canvas(root,width=450,height=350,highlightbackground="black") for i in range(40, …

Total answers: 1

Why do my widgets only show up in one case?

Why do my widgets only show up in one case? Question: I’m making a game based off of the periodic table with tkinter. I made the particle frame just fine, so I decided to copy the code and reuse it for the element frame, changing only the variable names. But for some reason, even though …

Total answers: 2

binding movement and rotation of kivy scatter widgets

binding movement and rotation of kivy scatter widgets Question: Below I have a code that displays 2 scatter widgets in a kivy screen. If one widget is dragged, the other also drags and vice versa. What I want is in addition to movement, if one is rotated, the other rotates in the same way. In …

Total answers: 1

Python tkinter text widget delete function doesn't work correctly

Python tkinter text widget delete function doesn't work correctly Question: I am creating a calculator app and i added this backslash button to it and here is the function for the number buttons : it works correctly and when i press a number it just adds it to the end of the current number . …

Total answers: 2

Passing variables between an open window and a window that hasn't been opened yet

Passing variables between an open window and a window that hasn't been opened yet Question: I am currently stuck on a problem of passing variables between two scripts in a python GUI code. I think I have figured out that the variable is not getting sent from the main widget to the secondary widget but …

Total answers: 1

How to include string after number in IntSlider?

How to include string after number in IntSlider? Question: I wanted to increase the size of the description of my variables and also include the measurement units after the value as indicated in this figure. My code: %matplotlib inline from ipywidgets import interactive import matplotlib.pyplot as plt import numpy as np a = widgets.IntSlider(description=’Força’, value=500, …

Total answers: 1