天道酬勤,学无止境

tkinter-layout

Different shapes of windows in tkinter

normally when you make a window in tkinter using Tk(), the standard shape of the window would be a square. Is there any way we can make the shape anything else?

2021-05-13 22:36:48    分类:问答    python   tkinter   tkinter-layout

How to add hover feature for text description on a Tkinter button?

I want to add a hover feature on a Tkinter button where if the user hovers the mouse cursor then description text displays. I also want to add some delay for that description to appear so that it would not be intrusive. I can try using the "<Enter>" and "<Leave>" binding of the button to a function and make some "Label" appear in some corner of the app. But this approach may not be the most elegant.

2021-05-13 15:53:21    分类:问答    python   button   tkinter   tkinter-layout

Tkinter Button command getting executed before clicking the button [duplicate]

This question already has answers here: Why is the command bound to a Button or event executed when declared? (5 answers) Closed 3 years ago. I have created a frame, In that i have two browse button, i want browse two file that ending with ".txt" extension and printing it on screen. In my scenario, browse function getting called before pressing Button's on the frame. Am expecting it should called when i press Button. Complete code attached. Kindly someone correct me what i did wrong. from Tkinter import * import tkFileDialog as filedialog global filename root = Tk() def browsefunc(entry)

2021-05-03 08:21:27    分类:问答    python   python-2.7   tkinter   tkinter-layout

How to change which tkinter Button is highlighted via arrow keys?

I am working on a keyboard app using tkinter library in python. I have made a keyboard. What I want is to highlight a key and on clicking on arrow keys I want to change that highlighted key. Here is my code for keyboard. from tkinter import * import tkinter Keyboard_App = tkinter.Tk() def select(value): if value == "<-": input = entry.get("1.0", 'end-2c') entry.delete("1.0", END) entry.insert("1.0", input, END) elif value == " Space ": entry.insert(tkinter.END, ' ') elif value == "Tab": entry.insert(tkinter.END, ' ') else: entry.insert(tkinter.END, value) buttons = [ '1', '2', '3', '4', '5',

2021-04-30 04:02:30    分类:问答    python   tkinter   tkinter-layout