tkinter-entry

tkinter ttk Entry widget -disabledforeground

别等时光非礼了梦想. 提交于 2019-12-13 19:17:12
问题 I was trying to change the color of the words in my ttk.Entr widget when I set the state to disabled , I looked up the manual, there's an option called disabledforeground , so I wrote a test snippet as below: (BTW, I'm under Python 2.7) from Tkinter import * from ttk import * root=Tk() style=Style() style.configure("TEntry",disabledforeground='red') entry_var=StringVar() entry=Entry(root,textvariable=entry_var,state='disabled') entry.pack() entry_var.set('test') mainloop() But the result

Getting variable out of Tkinter

感情迁移 提交于 2019-12-13 10:16:01
问题 I would like to ask if anyone knows how to get out a variable from an Entry in Tkinter to be used in future calculation. Let us assume that I want to create a prompt where the user needs to place two numbers in the two different Entry widgets. These numbers are to be used in another script for calculation. How can I retrieve the values from the prompt created in Tkinter? In my opinion, I would need to create a function with the code bellow and make it return the value from the Tkinter prompt.

How to get value from entry (Tkinter), use it in formula and print the result it in label

让人想犯罪 __ 提交于 2019-12-13 09:48:20
问题 When using the function entry of Tkinter, you can write a string value and do things with it; but I'm actually working with formulas. The idea is fairly simple: to put a bunch of boxes to fill with numbers (pressure, thrust, stress, temperature and so on) and then take that numbers, apply the formulas and show the results in the same window. How can I do that? I've been searching for hours and hours without getting a non confusing solution. Seems like the guy in this page had the same trouble

python tkinter Entry widget Dynamic Name

可紊 提交于 2019-12-13 07:59:05
问题 anyone can guide me of the following: I want to dynamically create the Entry widget and assigned hierarchical name (i.e. e1, e2, e3...etc), so that in next step easily reference back to collect the information. see my draft code below, its not working bowList = pd.DataFrame(np.empty([12,2]),columns=[['F','S']]) main2 = tki.Tk() main2.minsize(800,500) mb1 = tki.Menu(main2) fm = tki.Menubutton(mb1) l1 = tki.Label(main2, text="Fore Name") l1.place(x=50,y=5,width=70) l2 = tki.Label(main2, text=

How to append text to a label using text from a file and an entry in tkinter python

≡放荡痞女 提交于 2019-12-13 03:15:19
问题 I am making a tkinter python project, which is a to-do list. The to-do list label uses text from the 'To-Do List.txt' file, whose contents just say 'To Do List:' I am trying to enter text into an entry function and, when I press the 'Add Item' button, the text in the entry should add to the text in the label, and the text in the label is basically the txt file. The entry should add to the txt file. How should I go about doing this? I do not know how. Here is my code so far. import tkinter as

python3 tkinter Entry() cannot select text field until I click outside app window once

回眸只為那壹抹淺笑 提交于 2019-12-12 23:30:40
问题 I've written a very simple app with python3, tkinter, but am seeing some strange behaviour with Entry(). I'm new to tkinter and python. import os from tkinter import Tk, Entry, filedialog class MyGUI: def __init__(self,master): self.master = master self.date_entry = Entry(master) self.date_entry.pack() self.date_entry.insert(0,"test") self.master.mainloop() root = Tk() root.directory = os.path.abspath(filedialog.askdirectory()) my_gui = MyGUI(root) When I run this code, the second to last

how to Entry.insert() work with frames in tkinter?

别说谁变了你拦得住时间么 提交于 2019-12-11 19:12:09
问题 i am trying to make a program that help me in my work at the school and i made lots of progress with it but i am messing now i need to fined how to make the path of the file to show on the Entry widget i tried lots of the stuffs in here and i may didn't git the idea behind it please help me with it import tkinter as tk from tkinter.filedialog import askopenfilename from tkinter.messagebox import showerror from tkinter import ttk import xlrd class SchoolProjict(tk.Tk): def __init__(self, *args

Foriegn keyboard support for Tkinter snaps

泪湿孤枕 提交于 2019-12-11 14:08:37
问题 I am currently developing a snap for learning foreign languages with Tkinter. However, it seems that typing in a different script doesn’t work in the snap, though it does when run normally. Is there a special interface I need? By the way, I think it's running TCL 8.6. My snapcraft.yaml is as follows: name: prosakart base: core18 version: '0.1.0' icon: icon.png summary: Application for language memorization. description: | ProSakart is a language-learning application, specifically for

How do I make Bind and Command do the same thing in tkinter?

风格不统一 提交于 2019-12-11 09:42:09
问题 I have a tkinter GUI with an entry field and a validation button. I'd like to call the same function when I press a key in the entry, or when I click the button. The problem is, with the bind method on the entry, I need a "self" argument for my function to work, but not with the button. Here is the simplified code: from tkinter import * import tkinter.messagebox import tkinter.filedialog def function(): print("Here are some words.") my_window = Tk() text = StringVar() input_widget = Entry(my

Add multiple Entries and retrieve data from them dynamically

非 Y 不嫁゛ 提交于 2019-12-11 08:09:52
问题 Is there any way to add multiple Entries dynamically and get values from them? Like in the example below if I click Show Data button all data is shown in different Entries. Now if I change data in any of the Entries how can I get the updated data and save them to Values array? from tkinter import * from tkinter import ttk class Root(Tk): def __init__(self): super(Root, self).__init__() self.createMultipleEntries() def createMultipleEntries(self): self.values = [ ["Full Name", "Email", "Phone"