Questions tagged [tkinter-label]

95 questions
0
votes
2 answers

Reduce the lines of code (tkinter, Python, Multiple labels, entry)

Explanation: On Clicking submit button, the entries should appear in tree. I have restricted the entries fields so they can take only two values (using trace method). Problem 1: I have a total of 8 entries, which means the code has 8 StringVar, 8…
0
votes
0 answers

Is it better etiquette to create the Buttons and Labels outside of the functions and just grid them inside when needed for Tkinter?

For example, I am trying to create a greetings Label that says "Welcome to ..." so is it better to do: def main(): greeting = Label(root, text="Welcome to tictactoe! Player1 choose your letter:") greeting.grid(row=0, column=0) or include…
Sproll
  • 1
  • 1
0
votes
2 answers

Remove multiple label from tkinter

I'm trying to make a simple tkinter script that creates 10 numbers in the GUI after clicking a button. The problem is removing the numbers from the GUI. I can only remove one number. The numbers is beeing created via a loop. I've printed out the…
Baconflip
  • 47
  • 6
0
votes
0 answers

Tkinter Python: Residue Text from previous call after refreshing widgets in frame

I am trying to build an organized list for the "last-seen-time" of all of my sensors in the corresponding project with Python Tkinter. The bottom frame (whatever that is under the two list box), is suppose to refresh each time the "SEND TO CHECK"…
0
votes
2 answers

why is label "lorem" of sub-frame of page One is being displayed on start page?

I am following the answer of this: Switch between two frames in tkinter in the below mentioned code, I am making form with two pages, start page and page one, the question is that why is label "lorem" of sub-frame of page One is being displayed on…
jojo
  • 1
0
votes
1 answer

Change the image in the Label in Tkinter using a function

I am making a program GUI in Tkinter but I am stuck in this part. from Tkinter import * from PIL import Image, ImageTk def add_imgage(): player_label.destroy() player3_token = ImageTk.PhotoImage(Image.open('./gallery/Scissor_icon.jpg')) …
0
votes
1 answer

How to update label value when an entry value has changed without using any button?

I'm creating a program where I have two entries for receiving some values from the user. With that values, I want to make some calculations and display the result in a label. I don´t want to use any kind of button or widgets to refresh the value of…
0
votes
1 answer

Tkinter show label after function called when label should di

Tkiner display the label after callback function. but i display label in the top. def records(): lbl = tk.Label(recordWindow, text="recording") lbl.grid() Audio1() btn = tk.Button(recordWindow, text="click to…
0
votes
0 answers

How to change the color of a specific word in a tkinter label

I'm new to tkinter and I'm trying to change the color and background of a specific word in a label when I press "Return". The code works, but it changes the color of the entire label, and I don't know how I can specify it so it only changes the…
0
votes
1 answer

TkInter get width of specific text

Is there a way to find out what width a Label would be for a given text and font, without having to add it to the graphical elements currently being displayed. I need to get the information without any effect on the GUI, however momentary that…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
-1
votes
2 answers

i try to delete Label but i can't delete & my code a lot of line need somebody to advice

I'm writing a Tkinter Application. I'm trying to delete a Label by using destroy() but it is not working correctly. What would be the correct way to delete (or remove) the Label. Base code: typeimport tkinter from tkinter import * from tkinter…
-1
votes
2 answers

Tkinter - When adding "row=" to a Label in a for loop, items in list show up over each other

Sorry if the title is confusing I don't really know how to word it properly. Hopefully the code below will clear it up. When I run the program and I call print_names(), only the last name "Jenny" shows up. While if I call the other two functions,…
-1
votes
1 answer

Brackets are in the label

I made a little script in Python with tkinter and when I want to change the label with the results of the script, brackets are shown on each part of the results, between string variable and float. # tant que v n'est pas égale aux nombre de valeurs #…
-1
votes
1 answer

Adding a widget to a Label makes every other widget disappear

I`m using Python with PIL Short Version: I want to display an Image in the background (which only works with Labels to my knowledge?) Every widget has this Label now as master. I also want to add widgets later (with said Label as master) with a…
-1
votes
1 answer

Why I get like tuple value from StringVar when I click copy to clipboard button? I need text value

Why I get tuple value from StringVar()? When I click on Copy button, I get like this from my project ('n', 'o', 'i', 'Q', 'X', '2', 'd'). I need a text value from Copy button . a string without '' . from tkinter import * from tkinter import…
user15426885