Relative Content

Tag Archive for pythontkinter

Problem with the entry widget using Tkinter Python

from tkinter import * root = Tk() root.geometry(“1600×800+0+0”) root.title(“my notepad”) Tops = Frame(root, width=1650, height=50, bg=”light green”, relief=SUNKEN) Tops.pack(side=TOP) note = StringVar() Bottom = Frame(root, width=1600, height=655, bg=”light blue”, relief=SUNKEN) Bottom.pack(side=BOTTOM, fill=BOTH, expand=True) # Adjusted pack parameters txtstotal = Entry(Bottom, font=(‘arial’, 20, ‘bold’), textvariable=note, bd=10, insertwidth=4, bg=”light blue”, justify=”left”) txtstotal.pack(fill=BOTH, expand = True) root.mainloop() Here […]

problem with the entry widget in tkinter python

from tkinter import * root = Tk() root.geometry(“1600×800+0+0”) root.title(“my notepad”) Tops = Frame(root, width=1650, height=50, bg=”light green”, relief=SUNKEN) Tops.pack(side=TOP) note = StringVar() Bottom = Frame(root, width=1600, height=655, bg=”light blue”, relief=SUNKEN) Bottom.pack(side=BOTTOM, fill=BOTH, expand=True) # Adjusted pack parameters txtstotal = Entry(Bottom, font=(‘arial’, 20, ‘bold’), textvariable=note, bd=10, insertwidth=4, bg=”light blue”, justify=”left”) txtstotal.pack(fill=BOTH, expand = True) root.mainloop() here […]

Tkinter rows collapsing tic-tac-toe

Have worked with a friend through the tutorial for creating a tic-tac-toe game in Tkinter. We extended it to work for a 4×4 grid and wanted instead of using X’s and O’s to import our own custom images. We’ve managed to reconfigure the code that allows these images to be inserted when a grid square is clicked but we can’t work out why whenever a row or column is filled, it will collapse it down (whereas we want it to remain the same size). Is there a way so it keeps all the cells the same size throughout?

Adjusting frame size in tkinter grid layout

I have written a code in tkinter using grid layout in which my concern is with a frame that has scroll bar . I want it to expand to bottom of window by default . Here is the relevant code from tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) frtop=self.winfo_toplevel() #Flexible Toplevel of […]

adjusting contents of frame in tkinter grid layout using python

My aim is to stack a list of entries horizontally in frame using tkinter grid layout. Here is my code from tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) frtop=self.winfo_toplevel() #Flexible Toplevel of the window screen_width = self.winfo_screenwidth() screen_height = self.winfo_screenheight() print(“width=”+str(screen_width)+”, height=”+str(screen_height)) max_windows_size=str(screen_width)+”x”+str(screen_height) frtop.geometry(max_windows_size) self.grid() self.table_frame = Frame(self) self.table_frame.grid(column =0, row =0,sticky=’NSEW’) […]