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 7721157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:51:12+00:00 2026-06-01T03:51:12+00:00

I am creating a Menu test for my restaurant as a project and I

  • 0

I am creating a Menu test for my restaurant as a project and I have the GUI set up how I want but I have run into a problem with the Button updating the value its sending. My plan is for a menu item to appear on the GUI when the button is pressed, the employees then check the appropriate checkboxes (ingredients), then click the sumbit and continue button and the next menu item appears and they continue on the test. Right now I have it set up to where the area for the menu items starts out blank, when I click the button the first time the first item in my list appears but then is never updated no matter how many times the button is pressed. I’m pretty sure I am just setting the counter (what my button is sending) up wrong but I am kinda stumped… Here is a picture of my GUI to hopefully show you what I mean as well as the code I have so far. Thanks for you help it is much appreciated!

***Loop Items Here*** is where the menu items appear when button is pressed

from tkinter import *

class Example(Frame):

    def __init__(self, parent):
        Frame.__init__(self, parent, background="white")   

        self.parent = parent

        self.initUI()

    def initUI(self):

        self.parent.title("Wahoos Menu Test")
def main():

    def callBack(number):
        count = number + 1
        item(count)
    def item(number):
        menu = ['nft', 'nckt', 'cat', 'nck outer reef burrito',]
        m = Label(root, text=menu[number], fg="orange").grid(row=7, column=0)
    root = Tk()
    app = Example(root)
    #root.geometry("750x750+400+50")
    for r in range(20):
        for c in range(14):
            Label(root, text='',
                borderwidth=0).grid(row=r,column=c)
    count = -1
    B = Button(root, text ="Submit and Continue", relief=RIDGE, fg="black", command= lambda:callBack(count)).grid(row=19, column=7)
    L = Label(root, text="What comes in the following", fg="blue").grid(row=6, column=0)
    #I = Label(root, text="***Loop Items Here***", fg="blue").grid(row=7, column=0)
    V = Label(root, text="Veggies", fg="green").grid(row=1, column=11, sticky=W)
    v1 = IntVar()
    Checkbutton(root, text="Lettuce", variable=v1, fg="black").grid(row=2, column=11, sticky=W)
    v2 = IntVar()
    Checkbutton(root, text="Cabbage", variable=v2).grid(row=3, column=11, sticky=W)
    v3 = IntVar()
    Checkbutton(root, text="Cheese", variable=v3).grid(row=4, column=11, sticky=W)
    v4 = IntVar()
    Checkbutton(root, text="Ahee Rice", variable=v4).grid(row=5, column=11, sticky=W)
    v5 = IntVar()
    Checkbutton(root, text="Brown Rice", variable=v5).grid(row=6, column=11, sticky=W)
    v6 = IntVar()
    Checkbutton(root, text="Banzai Veg", variable=v6).grid(row=7, column=11, sticky=W)
    v7 = IntVar()
    Checkbutton(root, text="Red Cabbage", variable=v7).grid(row=8, column=11, sticky=W)
    v8 = IntVar()
    Checkbutton(root, text="Black Beans", variable=v8).grid(row=9, column=11, sticky=W)
    v9 = IntVar()
    Checkbutton(root, text="Cajun White Beans", variable=v9).grid(row=10, column=11, sticky=W)
    T = Label(root, text="Tortillas     ", fg="green").grid(row=1, column=12, sticky=W)
    t1 = IntVar()
    Checkbutton(root, text="Corn          ", variable=t1).grid(row=2, column=12, sticky=W)
    t2 = IntVar()
    Checkbutton(root, text="Flour", variable=t2).grid(row=3, column=12, sticky=W)
    P = Label(root, text="Proteins", fg="green").grid(row=1, column=13, sticky=W)
    p1 = IntVar()
    Checkbutton(root, text="Carne Asada", variable=p1).grid(row=2, column=13, sticky=W)
    p2 = IntVar()
    Checkbutton(root, text="Flamebroiled Chicken", variable=p2).grid(row=3, column=13, sticky=W)
    p3 = IntVar()
    Checkbutton(root, text="Blackened Chicken", variable=p3).grid(row=4, column=13, sticky=W)
    p4 = IntVar()
    Checkbutton(root, text="Flamebroiled Fish", variable=p4).grid(row=5, column=13, sticky=W)
    p5 = IntVar()
    Checkbutton(root, text="Pork", variable=p5).grid(row=6, column=13, sticky=W)
    p6 = IntVar()
    Checkbutton(root, text="Shrimp", variable=p6).grid(row=7, column=13, sticky=W)
    p7 = IntVar()
    Checkbutton(root, text="Tofu", variable=p7).grid(row=8, column=13, sticky=W)
    p8 = IntVar()
    Checkbutton(root, text="Blackened Mushroom", variable=p8).grid(row=9, column=13, sticky=W)
    p9 = IntVar()
    Checkbutton(root, text="Rice and Beans", variable=p9).grid(row=10, column=13, sticky=W)
    p10 = IntVar()
    Checkbutton(root, text="Banzai Veg", variable=p10).grid(row=11, column=13, sticky=W)
    S = Label(root, text="Sauces", fg="green").grid(row=1, column=14, sticky=W)
    s1 = IntVar()
    Checkbutton(root, text="Salsa", variable=s1).grid(row=2, column=14, sticky=W)
    s2 = IntVar()
    Checkbutton(root, text="Guacamole", variable=s2).grid(row=3, column=14, sticky=W)
    s3 = IntVar()
    Checkbutton(root, text="Sour Cream", variable=s3).grid(row=4, column=14, sticky=W)
    s4 = IntVar()
    Checkbutton(root, text="Roasted Pepper", variable=s4).grid(row=5, column=14, sticky=W)
    s5 = IntVar()
    Checkbutton(root, text="Ketchup", variable=s5).grid(row=6, column=14, sticky=W)
    s6 = IntVar()
    Checkbutton(root, text="Ranch", variable=s6).grid(row=7, column=14, sticky=W)
    s7 = IntVar()
    Checkbutton(root, text="Balsamic", variable=s7).grid(row=8, column=14, sticky=W)
    s8 = IntVar()
    Checkbutton(root, text="Mr. Lees", variable=s8).grid(row=9, column=14, sticky=W)
    s9 = IntVar()
    Checkbutton(root, text="Teriyaki", variable=s9).grid(row=10, column=14, sticky=W)
    s10 = IntVar()
    Checkbutton(root, text="Tapatio", variable=s10).grid(row=11, column=14, sticky=W)
    s11 = IntVar()
    Checkbutton(root, text="Cream Cheese", variable=s11).grid(row=12, column=14, sticky=W)
    s12 = IntVar()
    Checkbutton(root, text="Aoli", variable=s12).grid(row=13, column=14, sticky=W)

    root.bind('<Return>', callBack)
    root.mainloop()  


if __name__ == '__main__':
    main() 
  • 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-01T03:51:13+00:00Added an answer on June 1, 2026 at 3:51 am

    The problem is that count cannot be seen by the callback() function. Trying replacing it with global count at the start of the main() function. This FAQ on global vars in Python should help.

    def main():
        global count
        count = -1
    
        def callback(number):
            global count
            count = number + 1
            ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using Plato3 to write C programs. Im creating a menu-driven program but want
so I'm creating a menu, and I'm almost done with submenu, but I have
I have a problem when creating a menu in WPF. What happens is that
I am creating a menu that will have its menu items injected into it
I'm creating a menu and I want the buttons to pop I guess on
I run into a problem with jQuery UI - Autocomplete and IE8. I'm using
I am using multiview with asp menu creating tabs in menu. but by switching
I am creating Accordion menu using JQuery. I want to hide links according to
I'm creating a menu, but I think showing a window in each menu it's
I am creating a menu and for each menu component, I have a specific

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.