0

My first radio button overlaps with my frame for some reason, no matter what row or column I place them in.

from tkinter import *
from PIL import ImageTk, Image

root = Tk()
root.geometry("200x200")
root.title("Radio")
root.iconbitmap("C:/Users/rutab/Documents/Icons/Radio.ico")

frame = LabelFrame(root).grid(row = 3, column = 0, padx = 10, pady = 60)
b = Button(frame, width = 10).grid(row = 0, column = 0)

def click(value):
    global frame
    my_label = Label(frame, text = value).grid(row = 1, column = 0)

v = IntVar()
r_1 = Radiobutton(root, text = 'Python', variable = v, value = 1, command = lambda: click(v.get()))
r_2 = Radiobutton(root, text = 'Java', variable = v, value = 2, command = lambda: click(v.get()))
r_3 = Radiobutton(root, text = 'C++', variable = v, value = 3, command = lambda: click(v.get()))

r_1.grid(row = 0, column = 0)
r_2.grid(row = 1, column = 0)
r_3.grid(row = 2, column = 0)

root.mainloop()

This is the output

As you can see in the output, the button shows how my frame is overlapping the radio button. How do Place my frame under all the radio buttons?

  • 1
    Does this answer your question? [Tkinter: AttributeError: NoneType object has no attribute ](https://stackoverflow.com/questions/1101750/tkinter-attributeerror-nonetype-object-has-no-attribute-attribute-name) – TheLizzard Aug 17 '21 at 14:37
  • You aren't actually putting anything inside the `LabelFrame` because `frame` is always `None` in your code. – TheLizzard Aug 17 '21 at 14:38
  • @TheLizzard Yea thanks, that was the issue I was facing – Loïc Rutabana Aug 17 '21 at 14:42

0 Answers0