FAQ Database Discussion Community


How to get an entry.bind and a button do the same thing?

python,button,tkinter,bind,entry
I think the name of the topic is pretty clear, I haven't found any answer elsewhere so I came to ask for it. I have a tkinter GUI with an entry and a validation button. I'd like to call the same function when I press a key in the entry,...

tkinter entry variable from function

python,tkinter,global,entry
This should be easy but I am suffering search fatigue for the answer I need. The code below pops up an input window. I make entries into the entry fields and the function show_entry_fields() gets the input and the window closes. I then want to use the new entry variables...

tk entry background color change in readonly mode

tcl,tk,entry
Hi I have a requirement where i need to create table and the cells would be readonly. But along with readonly mode, the cells need to have colored background. Now with the given options, i tried doing something like below but with no luck. Since I am learning GUI designing,...

Java HashMap iteration Map.Entry<> vs Entry<>

java,dictionary,hashmap,iteration,entry
I am new to Java and writing java on a Mac using HashMap. However I encountered a problem that I can't find the answer import java.util.Map; import java.util.HashMap; public class Test { public static void main(String[] args) { Map<String, Integer> hm = new HashMap<>(); hm.put("a", 1); hm.put("b", 2); for (Entry<String,...

tkinter python 3.4 set zero if DoubleVar or IntVar is empty

python,string,tkinter,double,entry
I am trying to set a text-box or EntryBox to 0 if this entry box is empty I can do it if the entrybox's textvariable is a String, but I cant if is a DoubleVar or an IntVar can somebody help me here is my code mGui = Tk() mGui.title("GUI")...

delete from database entry PHP script deletes all entries

php,mysql,database,delete,entry
I'm trying to add a delete function for my blog where the logged in user can click on the delete link, but it just does not work. this is the form for display: <div id= "blogtitle"><?php echo $title; ?></div><div id= "date"><?php echo $date; ?></div> <div id="contant"> <?php echo $contant; ?>...

Error: AttributeError: 'Application' object has no attribute 'message'

python,python-3.x,tkinter,entry,attributeerror
Every time I type a number into one of the entry widgets I get this error. I can't tell where I went wrong and I'm very new to tkinter so it's not so intuitive. When I remove self.change_message('clear') it doesn't recognise p1 as a float and thus doesn't carry on...

Items are listed in listbox, I want to use foreach to delete the items from SQL [closed]

sql,listbox,delete,entry
private void SearchTable() { try { using (SqlConnection con = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=Steripack;Integrated Security=True")) { foreach (var item in lstCompleted.Items) { string killtag = item.ToString(); con.Open(); using (SqlCommand command = new SqlCommand("DELETE FROM tblAsset1 WHERE tagID = " + killtag)) { command.ExecuteNonQuery(); lstCompleted.Items.Add("Removed: " + killtag); } con.Close(); }...

How to properly use HashMap::entry?

hashmap,rust,entry
This snippet of code: use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; fn main() { let mut vars = HashMap::<i32, f64>::new(); let key = 10; let val = match vars.entry(key) { Vacant(entry) => entry.set(0.0), Occupied(entry) => entry.into_mut(), }; *val += 3.4; println!("{}", val); } give error like this in playpen: :8:29: 8:37 error:...

How to insert a temporary text in a tkinter Entry widget?

python,python-2.7,python-3.x,tkinter,entry
How to insert a temporary text in a tkinter Entry widget? For example, I have a Label User and next to it I have an Entry widget which should have some text "Enter your username..." at the beginning of the application, and while putting cursor on the Entry widget, it...

OnValidate - registering lots of different validations

tkinter,entry
I wrote a GUI tool which has a lot of variables that can be changed via entrys. Every entry has a different validation rule and i only show around 20 items per page (array of entries). I fear that when i register too many validations (on TK) without unregistering (?)...

How to get input from Entry and set it as the text in a Label

python,tkinter,label,entry
how do I get the Input from an Entry widget and set it as the text in a label widget. I have tried the following: l_one = Label(window, text= lambda: self.entry_1.get()) l_one.grid(column = 0, row = 0) To be honest, I didn't think it would work but it was all...

Tkinter Messagebox causing Entry to disable

python,tkinter,messagebox,entry
So I was creating a simple input window with Tkinter but whenever i have a showinfo displaying i can't type in the entry box import tkinter as tk from tkinter import * from tkinter.messagebox import * root = tk.Tk() root.title("hello world") root.minsize(700,600) abc = StringVar() abc.set("abc") Entry(root, bd = 1,...

Tkinter dialog showinfo loop error

python,dialog,tkinter,entry
I'm fairly new to python and am working on a CS problem where I have to design a simple number guessing game. The game must also contain a Tkinter Label widget that explains the rules of the game (pick a number between 1 - 100), an Entry widget that takes...

Python 2.5 Tkinter Highlight Spinbox Entry

python,tkinter,spinner,entry
This question seems trivial to me but I can't seem to find anything related to it, and the Spinbox docs don't seem to help. Is there any way to select all of the text in a Spinbox widget? I'm currently trying: self.spinbox.selection_clear() self.spinbox.selection('range', 0, END) to no avail. I have...