0

In my project I have a menu bar and was wanting to remove the small space under it. I have went through the documentation for the tkinter menu bar and can not find anything related I have tried the border option as that would seem most relevant and it changed nothing as well as the relief option. In the below image you can see the thin gray line under the menu bar.

enter image description here

from tkinter import *

class GUI(Frame):
    def __init__(self, parent):
        Frame.__init__(self,parent)
        self.place(relwidth=1, relheight=1)

    def start(self):
        #Menu Bar
        self.mBar = Menu(self, relief=None)
        #File Menu
        fMenu = Menu(self.mBar, tearoff=0)
        #File Menu End
        #Edit Menu
        eMenu = Menu(self.mBar, tearoff=0)
        #Edit Menu End
        #Help Menu
        hMenu = Menu(self.mBar, tearoff=0)
        #Help Menu End
        self.mBar.add_cascade(label="File", menu=fMenu)
        self.mBar.add_cascade(label="Edit", menu=eMenu)
        self.mBar.add_cascade(label="Help", menu=hMenu)
        root.config(menu=self.mBar)
        #Menu Bar End

        #Main Frames
        self.tFrame = Frame(self, bg="White")
        self.tFrame.pack_propagate(False)
        self.tFrame.place(x=0, y=0, relwidth=1, height=50)

        self.lFrame = Frame(self, bg="White")
        self.lFrame.pack_propagate(False)
        self.lFrame.place(x=0, y=52, width=224, relheight=1)

        self.rFrame = Frame(self, bg="White")
        self.rFrame.pack_propagate(False)
        self.rFrame.place(x=226, y=52, relwidth=0.83, relheight=1)

        self.configure(bg="red")

if "__Main__":
    root = Tk()
    root.title("Test <@:)")
    root.geometry("700x500")

    gui = GUI(root)
    gui.start()
cdw100100
  • 192
  • 1
  • 13
  • 1
    Relevant: [how-to-make-border-around-ttk-optionmenu](https://stackoverflow.com/questions/51534878) – stovfl Feb 19 '20 at 11:58
  • 1
    note: `if "__Main__":` is almost certainly not doing what you expect. It's the equivalent of `if True:`. – Bryan Oakley Feb 19 '20 at 14:05
  • @BryanaOakley Thank you for the helpful information. I never thought about it. Also I would like to thank you. You have been helping me with my python programming since I started I could not find a way to get ahold of you to thank you! – cdw100100 Feb 19 '20 at 23:57

0 Answers0