Bonjour, pour commencer voila mon code:
from Tkinter import *
def hello():
print "Hello"
root = Tk()
root.attributes('-fullscreen', 1)
screensizex = root.winfo_screenwidth()
screensizey = root.winfo_screenheight()
mainframe = Frame(root, height=(screensizey-(screensizey/25)), width=screensizex, bg="#50a9ad")
mainframe.grid(row=0)
menuframe = Frame(root, height=(screensizey/25), width=screensizex)
menuframe.grid(row=1, sticky="w")
startmenu = Menubutton ( menuframe, text="Start", relief=RAISED, direction="above", width=8,
height=1)
startmenu.grid(row=0, column=0)
startmenu.place(relx=0.03, rely=0.5, anchor=CENTER)
startmenu.menu = Menu(startmenu, tearoff=0)
startmenu["menu"] = startmenu.menu
startmenu.configure(font=("Arial", 8, "bold"))
startmenu.menu.add_command(label="Next Day", command=hello)
startmenu.menu.add_separator()
startmenu.menu.add_command(label="Save", command=hello)
startmenu.menu.add_command(label="Load", command=hello)
startmenu.menu.add_separator()
startmenu.menu.add_command(label="Quit", command=root.quit)
startmenu.menu.configure(font=("Arial", 8))
root.mainloop()
Ce que je voudrais obtenir est un menu en bas de la page come ceci:
Mais j'obtiens ceci:
Le menu flotte au dessus du bouton au lieu d'y etre attache et je n'arrive pas a comprendre pourquoi....