tkinter-layout

tkinter.Frame.Grid sizing not displaying correctly

不羁的心 提交于 2020-04-18 06:07:02
问题 Hello I am making a table with a header for text to name the columns, cells to store data, and scrolling. The problem I'm having is that my Table is not displaying correctly. What should happen is the Headers should display above with no other space below them. (other than the small padding I added) The cells display correctly right below the headers. The scrolling works for the cells in the y direction. The scrolling also works in the x direction for both the cells and headers. The function

The Tkinter Pack Geometry Manager - options

泪湿孤枕 提交于 2020-04-17 19:02:35
问题 I am teaching myself TKINTER at the moment. I have written... self.frameBottom = tk.Frame(master) self.frameBottom.pack(side=tk.BOTTOM, fill=tk.BOTH) self.textBox = tk.Text(master, height=1) self.textBox.pack(side = tk.LEFT, expand=1, fill=tk.X) self.searchButton = tk.Button(master, text="Search", command=self.searchButtonPress) self.searchButton.pack(side = tk.RIGHT) self.textBoxResults = tk.Text(self.frameBottom) self.textBoxResults.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) however the

The Tkinter Pack Geometry Manager - options

痞子三分冷 提交于 2020-04-17 19:00:45
问题 I am teaching myself TKINTER at the moment. I have written... self.frameBottom = tk.Frame(master) self.frameBottom.pack(side=tk.BOTTOM, fill=tk.BOTH) self.textBox = tk.Text(master, height=1) self.textBox.pack(side = tk.LEFT, expand=1, fill=tk.X) self.searchButton = tk.Button(master, text="Search", command=self.searchButtonPress) self.searchButton.pack(side = tk.RIGHT) self.textBoxResults = tk.Text(self.frameBottom) self.textBoxResults.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) however the

The Tkinter Pack Geometry Manager - options

巧了我就是萌 提交于 2020-04-17 18:59:49
问题 I am teaching myself TKINTER at the moment. I have written... self.frameBottom = tk.Frame(master) self.frameBottom.pack(side=tk.BOTTOM, fill=tk.BOTH) self.textBox = tk.Text(master, height=1) self.textBox.pack(side = tk.LEFT, expand=1, fill=tk.X) self.searchButton = tk.Button(master, text="Search", command=self.searchButtonPress) self.searchButton.pack(side = tk.RIGHT) self.textBoxResults = tk.Text(self.frameBottom) self.textBoxResults.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) however the

Tkinter button expand using grid

拜拜、爱过 提交于 2020-01-24 03:57:39
问题 I'm new to coding, just learning Python. I searched for answers but could not find one. I'm trying to make a calculator for learning purposes, but I cannot make the bottom keyboard frame expand, or buttons inside expand to match the borders of the root window Here is my code: from tkinter import * # main window configuration root=Tk() root.geometry("1000x1000") root.grid_columnconfigure(0, weight=1) root.grid_rowconfigure(0, weight=1) # main window frames topmenu=Frame(root,padx=5,pady=5)

How to align label, entry in tkinter

牧云@^-^@ 提交于 2020-01-16 14:10:43
问题 I am really frustrated, trying to align a label and entry buttons in tkinter. I wanted to create a GUI like below The above page developed using page tool. I written a code to get the same kind of page, but it has lot of misalignment. from Tkinter import * root = Tk() root.title("Nokia Performance") root.geometry("583x591+468+158") root.title("NOKIA _ANSI Performance") root.configure(borderwidth="1") root.configure(relief="sunken") root.configure(background="#dbd8d7") root.configure(cursor=

How to align label, entry in tkinter

和自甴很熟 提交于 2020-01-16 14:10:39
问题 I am really frustrated, trying to align a label and entry buttons in tkinter. I wanted to create a GUI like below The above page developed using page tool. I written a code to get the same kind of page, but it has lot of misalignment. from Tkinter import * root = Tk() root.title("Nokia Performance") root.geometry("583x591+468+158") root.title("NOKIA _ANSI Performance") root.configure(borderwidth="1") root.configure(relief="sunken") root.configure(background="#dbd8d7") root.configure(cursor=

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

微笑、不失礼 提交于 2019-12-30 09:46:27
问题 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

tkinter placement of widgets

﹥>﹥吖頭↗ 提交于 2019-12-25 01:26:31
问题 Consider the following simple code: from tkinter import * mainFrame = Frame(parent, bd=5, bg="yellow").pack(expand=True,fill=BOTH) frameA = Frame(mainFrame, bd=5, bg="green").place(anchor=NW, relx=0, rely=0 , relwidth=1.0, height=40) my_label = Label(mainFrame, text="Hello world ", bg="red").place(in_=frameA, relx=0, anchor=NW, rely=0, relwidth=0.5) frameB = Frame(frameA, bd=5, bg="gold").place(in_=frameA , anchor=N, relx=0.5, rely=0.8, width=30, height=50) The result looks like this: The

TclError: bad window path name (Python)

▼魔方 西西 提交于 2019-12-13 00:45:24
问题 In one of the views there is a button for close the actual view, and it works, but when I try to open again the view it shows me the next error: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1545, in __call__ return self.func(*args) File "/home/htm97/Documents/data/workspace/repositories/projects-h/locker-system/src/gui/MainMenu.py", line 27, in verify_lockers_window self.app = vl.Lockers(self.vlWindow) File "/home/htm97