Questions tagged [tkinter-layout]

378 questions
9
votes
1 answer

Tkinter button expand using grid

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…
5
votes
1 answer

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…
Jawad Malik
  • 608
  • 5
  • 21
4
votes
1 answer

how to trigger a function on tab change from tkinter notebook?

Does anyone know how to trigger a function once a different tab is selected in the tkinter notebook? This is hat i what to accomplish. Lets say i have two tabs, tab1 and tab2: if tab1 is selected: canvas3.unbind_all() …
Ignacio Bares
  • 53
  • 1
  • 5
4
votes
1 answer

How to group two sets of buttons on each top corner of the screen using Tkinter?

I am trying to program a GUI that will display three buttons on the top left corner and four buttons on the top right corner of the window. I attempted to do this by creating different frames: A "left" frame where i place the first of the group of…
J Dom
  • 63
  • 7
4
votes
1 answer

Making Tkinter Multiple Windows Have One Icon in the Task Bar

I used Tkinter , with several Toplevels, They appear separate in the Ubuntu Taskbar, instead of being together as with the case of say opening multiple firefox windows (i mean they all group under firefox icon together , the required can be…
4
votes
1 answer

Tkinter Button command getting executed before clicking the button

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…
velpandian
  • 431
  • 4
  • 11
  • 23
3
votes
1 answer

TKInter widgets having different width even after setting same width

I am trying to build a small window in tkinter, but I observed that different widgets take on different widths even when set with the same width. Here's the output that I can see on running the code: The black widget in first row is an Entry widget…
KCK
  • 2,015
  • 2
  • 17
  • 35
3
votes
0 answers

How to apply transparent background in tkinter window of linux (not alpha)?

I want to make some portion of a tkinter window transparent. I have successfully achieved it in windows and mac os using the following methods: In windows: root.attributes("-transparentcolor", '#000001') root.config(bg="#000001") In…
Akascape
  • 219
  • 2
  • 11
3
votes
1 answer

tkinter deforms my frames after inserting objects

So I want to insert some objects in a frame, but when I firstly added a button the frames where were they weren't suppoused to. Before After And this is the code: import tkinter as tk root = tk.Tk() root.geometry("1200x700") # Main frames frame1 =…
3
votes
1 answer

How to remove vertical padding of label in tkinter completely?

I want to create a desktop-application using tkinter. When placing text (of big size) in Labels, I always get a large vertical padding. Can I anyhow get rid of this additional space? I would like to place the text right on the bottom of the label. I…
Georg Edlbauer
  • 205
  • 2
  • 12
3
votes
1 answer

Tkinter columnconfigure weight not adjusting

I am new to the Tkinter module. I only have experience with PyQt5. I am playing with a couple widgets in my Frame. They are three buttons, and I am trying to expand their size relative to the size of the window. To do this I am using…
thebtcfuture
  • 37
  • 2
  • 4
3
votes
3 answers

Tkinter buttons not showing text on my mac, although code works on others computers

I have a functioning code that will not show text on the buttons unless I click and hold the button. When releasing the button's text becomes blank again. I have tried solving this on other forums and please note: THERE IS NOTHING WRONG WITH THE…
S. Argentina
  • 58
  • 1
  • 7
2
votes
0 answers

How to stop tkinter frame from shrinking to fit content

im attempting to stop a tkinter frame from shrinking to fit content and ive already tried left_frame.propogate(false) and achieved an invalid syntax result, if anyone can help me out that would be great Here is the code: root =…
Asher
  • 19
  • 1
2
votes
0 answers

Tkinter GUI Layout

I'm new to tkinter and need help to try make a layout for my tkinter program, but I just can't seem to figure out how to make it work. I want to have the layout to be somewhat like this. What I ended up with instead was something like this. The…
peanutt
  • 21
  • 1
2
votes
2 answers

Tkinter button background color is not working in mac os

I am trying to change the bg color of a tkinter button on my mac (catalina) but instead of getting a colored background, it is showing a blank white space in the layout. The button code I used: button_open = Button(root, width=45, bg="#82CC6C",…
Akascape
  • 219
  • 2
  • 11
1
2 3
25 26