Questions tagged [tkinter-layout]

378 questions
1
vote
1 answer

what is the function of window = Tk() in this program as leaving it out gives the same output

from tkinter import * window = Tk() sample = Label(text="some text") sample.pack() sample2 = Label(text="some other text") sample2.pack() sample.mainloop() Whats the difference between sample.mainloop() and…
Kun.tito
  • 165
  • 1
  • 7
1
vote
1 answer

How to get current height and width of a cell in Tkinter module of Python

I want to get current size of a cell in tkinter's grid packaging. Not just default, but after resizing as well. How do I do that?
ivan199415
  • 375
  • 3
  • 12
1
vote
1 answer

I can't seem to find from the highlighted padding is coming from in the following picture of the gui I am designing with tkinter

I am a beginner in tkinter and has been playing around with what I have learnt so far. The following is the code which I find is only relevant to answer my question and below that I have attached the picture of the gui I have got so far. # Frame for…
1
vote
1 answer

Center and put multiple items on the same line using Tkinter

I want to put a Label and an Entry widgets on the same line and center them. I saw on multiple posts that to center, pack() method was easier. But, to put on the same line, it's grid(). With grid(), I suppose I have to build all the layout, then…
Elias
  • 77
  • 7
1
vote
2 answers

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?
Jonathan
  • 63
  • 1
  • 6
1
vote
1 answer

Why isn't the menu showing up? - Tkinter

I'm trying to do a menu using tkinter. But when I run the code, the window appears, but the menu doesn't. I'm getting no errors. Here is my code: from tkinter import * root = Tk() root.geometry("500x300") menu = Menu(root) file_menu = Menu(menu,…
1
vote
1 answer

How to return an alert for a specific input using Tkinter?

I have created a mock search engine using Tkinter. I want the user to input the word "test" in the search engine and hit submit. This should return an alert. If the user inserts anything other than the word "test", then I want the search engine to…
1
vote
1 answer

Tkcalendar: Right align calendar dropdown with the DateEntry

By default the calendar dropdown & DateEntry widgets are left-aligned. In one case, the calendar is getting out of the screen as shown in the pic. Can we somehow right-align the calendar dropdown with respect to the corresponding DateEntry widget.
Harsh Khad
  • 99
  • 1
  • 7
1
vote
1 answer

how to get tab_id to set it as active tab

I am trying to build a text editor using tkinter. i just wanted to set the focus in newly opened tab.By using a static tab_id i can set this for instant but if I have more than 15 tabs at a time it is difficult to find tab_id . i want tab_id with…
Pavan kumar
  • 478
  • 3
  • 16
1
vote
1 answer

how to give boarder to the text box using Tkinter.I have tryed giving bg as some value but still not able to see the boarder appearing

#Creating GUI with tkinter import tkinter as tk from tkinter import * def send(): msg = EntryBox.get("1.0",'end-1c').strip() EntryBox.delete("0.0",END) if msg != '': ChatLog.config(state=NORMAL) ChatLog.insert(END,…
rakesh
  • 29
  • 1
  • 6
1
vote
1 answer

ttk Notebook tabs resizing when adding a new tab

I'm working on an application using Tkinter (for the first time so please be kind). It is going to have 3 different tabs along the top, each containing multiple widgets etc which are all being placed using grid. The issue I am facing is when I try…
Hektar
  • 71
  • 7
1
vote
1 answer

Tkinter Parent Frame seems to shrinks inside Button

I'm struggling to display a Button inside a Frame (which will contain other buttons). The root Window I'll put this Frame into has to be organized as a Grid (there will be more widgets), but the Frame has to be organized with pack(). My aim is to…
1
vote
1 answer

How can I align elements across different frames in tkinter?

I am reorganizing the structure of a GUI, and I am having some alignment issues. I have a LabelFrame on the left containing a matplotlib canvas, and I have a Notebook on the right containing several LabelFrames in tabs, each containing another…
KBriggs
  • 1,220
  • 2
  • 18
  • 43
1
vote
0 answers

When Hover ,Change Canvas or Label position smoothly

I have a GUI made with TKinter in Python and a canvas that come up when hovering on it but the problem is that when i hover many times in a short period on the canvas ,it will disappear . So, i want it to be more proffesionel code : from sys…
Mahdi
  • 11
  • 2
1
vote
1 answer

Is there a way that I can center a grid in tkinter?

My idea is to make a GUI with a grid and I want that the grid it self to be centered in the window. root = Tk() root.state('zoomed') telaInicial = Frame(root) botaoNovoAluno = Button(telaInicial, text = "Novo aluno", padx = 5, pady =…
Frixer
  • 27
  • 6