Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:05:24+00:00 2026-06-12T15:05:24+00:00

After tinkering around with tkinter I can’t seem to make my window look quite

  • 0

After tinkering around with tkinter I can’t seem to make my window look
quite how I want it to look. But overall, I’m not sure what the File Edit View
layout is referred to. Is this is a toolbar or a menu?

So far my gui looks much less native osx than I would like. Should I just ditch
tkinter all together?

Does anyone have a code snipped that gives the general osx layout? That would be a big help.
Maybe I’m just not grasping the gui programming aspect conceptually.

thanks

I want to add menus to the following code

from tkinter import *
from tkinter import ttk


def undef(*args):
    pass
def undef2(*args):
    pass

root = Tk()


root.title("KDM Checker Beta ")

mainframe = ttk.Frame(root, padding="5 5 5 5")
mainframe.grid(column=12, row=12, sticky=(N, W, E, S))
mainframe.columnconfigure(0, weight=1)
mainframe.rowconfigure(0, weight=1)






countryvar = StringVar()
country = ttk.Combobox(mainframe, textvariable=countryvar)
country['values'] = ('dolby', 'sony', 'doremi')
country.grid(column=1, row = 1)


DATE = StringVar()
VENUE = StringVar()
UUID = StringVar()
SERVER_SERIAL = StringVar()

DATE_entry = ttk.Entry(mainframe, width=8, textvariable=DATE)
DATE_entry.grid(column=3, row=4, sticky=(W, E))

VENUE_entry = ttk.Entry(mainframe, width=8, textvariable=VENUE)
VENUE_entry.grid(column=3, row=8, sticky=(W, E))

UUID_entry = ttk.Entry(mainframe, width=8, textvariable=UUID)
UUID_entry.grid(column=3, row=16, sticky=(W, E))



state = StringVar()
mount = ttk.Radiobutton(mainframe, text='dolby', variable=state, value='dolby')






ttk.Label(mainframe, textvariable=DATE).grid(column=1, row=4, sticky=(W, E))
ttk.Label(mainframe, textvariable=VENUE).grid(column=1, row=8, sticky=(W, E))
ttk.Label(mainframe, textvariable=UUID).grid(column=1, row=16, sticky=(W, E))


ttk.Label(mainframe, text="KDM Window").grid(column=1, row=4, sticky=E)
ttk.Label(mainframe, text="Venue").grid(column=1, row=8, sticky=E)
ttk.Label(mainframe, text="UUID").grid(column=1, row=16, sticky=E)

for child in mainframe.winfo_children(): child.grid_configure(padx=3, pady=9)

DATE_entry.focus()

root.bind('<Return>', undef)

root.mainloop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:05:26+00:00Added an answer on June 12, 2026 at 3:05 pm

    To create a menubar you need to create an instance of the Menu class, then use it as the value of the menubar attribute of your main application. From there you can create other menus and attach them to the menubar with add_cascade.

    For example:

    import tkinter as tk
    import sys
    
    class ExampleApp(tk.Tk):
        def __init__(self):
            tk.Tk.__init__(self)
            self._create_menubar()
            self.text = tk.Text()
            self.text.pack(side="top", fill="both", expand=True)
    
        def _create_menubar(self):
            # create a menu for the menubar and associate it
            # with the window
            self.menubar = tk.Menu()
            self.configure(menu=self.menubar)
    
            # create a File menu and add it to the menubar
            file_menu = tk.Menu(self.menubar, tearoff=False)
            self.menubar.add_cascade(label="File", menu=file_menu)
            file_menu.add_command(label="Quit", command=self.on_quit)
    
            # create a Edit menu and add it to the menubar
            edit_menu = tk.Menu(self.menubar, tearoff=False)
            self.menubar.add_cascade(label="Edit", menu=edit_menu)
            edit_menu.add_command(label="Cut", underline=2, command=self.on_cut)
            edit_menu.add_command(label="Copy", underline=0, command=self.on_copy)
            edit_menu.add_command(label="Paste", underline=0, command=self.on_paste)
    
            # create a View menu and add it to the menubar
            view_menu = tk.Menu(self.menubar, tearoff=False)
            self.menubar.add_cascade(label="View", menu=view_menu)
            view_menu.add_cascade(label="Whatever", command=self.on_whatever)
    
        def log(self, s):
            self.text.insert("end", s + "\n")
            self.text.see("end")
    
        # not good programming style, but I'm trying to keep 
        # the example short
        def on_cut(self): self.log("cut...")
        def on_copy(self): self.log("copy...")
        def on_paste(self): self.log("paste...")
        def on_quit(self): sys.exit(0)
        def on_whatever(self): self.log("whatever...")
    
    if __name__ == "__main__":
        app = ExampleApp()
        app.mainloop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to HTML5/Canvas/Game programming, but have been tinkering around with it after reading
After tinkering with this for hours I am hoping someone can shed some insight
After several hours of tinkering I cannot seem to figure this out. I have
After spending quite a bit of time trying to design my way around the
After many hours of research and tinkering, I've finally managed to get backbone.js routes
After discovering about Javascript namespaces, I tried to implement them but I run into
After I click update in the grid view, the code works successfully. But when
After autheticating my user, I want to put a reference in the session to
After following: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview I can sign up a user via Facebook. But I'm struggling
I've been tinkering around with Flex RemoteObjects, and I've found that they aren't very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.