Hello, i was just wondering how i could make these buttons appear on the screen in the same position, but so the code is simpler and easy to use.

## Screen design draft for major project
## Filename: majorProjectDesignDraft20090222.pyw
##

import os
from Tkinter import *
import tkFileDialog

class Application(Frame):
    def __init__(self, master=None):
        self.master = master
        self.menubar = Menu(self.master)
        Frame.__init__(self)
        menu = Menu(root)
        root.config(menu=menu)
        filemenu = Menu(menu)
        menu.add_cascade(label='File', menu=filemenu)
        filemenu.add_command(label='Open', command=self.openfile)
        filemenu.add_command(label='Save', command=self.savefile)
        filemenu.add_command(label='Quit', command=root.destroy)
        infomenu = Menu(menu)
        menu.add_cascade(label='About...', menu=infomenu)
        infomenu.add_command(label='About Food Ordering System', command=self.about)
        self.grid()
        self.createHelp()
        self.createRegister()
        self.createHeader()
        self.createSpace()
        self.createMenu()
        self.createOrder()
        self.click
#        self.toggle()
#        self.hello()


    def createWidgets(self):
        self.grid()
        font=("Calibri", 12)
        self.varlist=[]

    def savefile(self):
        import time
        text_file=open((self.varlist[0].get()) + (self.varlist[1].get()) + '_inf.txt', 'w')
        now = time.localtime(time.time())
        text_file.write("Date is: " +time.asctime(now)+'\n') ## newline was missing
        text_file.write('\n'.join([x.get() for x in self.varlist]))
        text_file.close()
        for var in self.varlist: var.set('') # clear for next student and sign of saving        

    def openfile(self):
        filename = tkFileDialog.askopenfilename()
        
        if os.path.isfile(filename):
            f = list(open(filename,'r'))
            f.pop(0) ## drop date from front
            for var in self.varlist:
                if f: var.set(f.pop(0)) ## from front=0
        else: print 'No file chosen'

    def about(self):
        print("Created by Rhys Chamberlain")

    def createHeader(self):
        top=self.winfo_toplevel()
        top.rowconfigure(0,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(0, weight=1)
        self.columnconfigure(0, weight=1)
        self.heading = Label ( self, text="Food Ordering System",relief=FLAT, font=('Arial', 30))
        self.heading.grid(row=0, column=0)

    def createSpace(self):
        top=self.winfo_toplevel()
        top.rowconfigure(1,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.columnconfigure(0, weight=1)
        self.heading = Label ( self, text="",relief=FLAT, font=('Arial', 20))
        self.heading.grid(row=1, column=0)
    
    def createHelp(self):
        top=self.winfo_toplevel()
        top.rowconfigure(2,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(2, weight=1)
        self.columnconfigure(0, weight=1)
        self.button = Button ( self, text="HELP",relief=FLAT, font=('Arial', 20))
        self.button.grid(row=2, column=0)

    def createRegister(self):
        top=self.winfo_toplevel()
        top.rowconfigure(3,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(3, weight=1)
        self.columnconfigure(0, weight=1)
        self.button = Button ( self, text="REGISTER AS MEMBER",relief=FLAT, font=('Arial', 20))
        self.button.grid(row=3, column=0)

    def createOrder(self):
        top=self.winfo_toplevel()
        top.rowconfigure(5,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(5, weight=1)
        self.columnconfigure(0, weight=1)
        self.button = Button ( self, text="ORDER FOOD",relief=FLAT, font=('Arial', 20,))
        self.button.grid(row=5, column=0)

    def createMenu(self):
        self.mb = Menubutton ( self, text='FOOD MENU',
                               relief=FLAT, font=('Arial', 20))
        top=self.winfo_toplevel()
        top.rowconfigure(6,weight=1)
        top.columnconfigure(0, weight=1)
        self.rowconfigure(6, weight=1)
        self.columnconfigure(0, weight=1)        
        self.mb.grid(row=6, column=0)
    
        self.mb.menu = Menu (self.mb, tearoff=0)
        self.mb['menu'] = self.mb.menu

        Meat = self.mb.menu.add_cascade ( label='Meat')
        self.menubar = Menu
        self.casmenu = Menu
        self.casmenu.choices = Menu
        self.casmenu.choices.wierdones = Menu(self)
        self.casmenu.choices.wierdones.add_cascade(label='Steak')
        self.casmenu.choices.wierdones.add_cascade(label='Garlic Prawns')
        Seafood = self.mb.menu.add_cascade ( label='Seafood')

        Pasta = self.mb.menu.add_cascade ( label='Pasta')

        Vegitarian = self.mb.menu.add_cascade ( label='Vegitarian')

        Desserts = self.mb.menu.add_cascade ( label='Desserts')

        Beverages = self.mb.menu.add_cascade ( label='Beverages')

     
root = Tk()
app = Application()
app.master.title("Food Ordering System")
root.geometry( "400x300+400+300")
root.resizable(0,0)
app.mainloop()
root.mainloop()

How do you mean 'same position'? I don't get what you want to do. If you want more precise positioning, then use place instead of grid.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.