Reputation: 454
using the Python 2.7 Tkinter Grid Layouter, i would like to do something like
root.button = Button(root, bg = 'green', ....)
root.button.grid(...)
in order to get a green button. Running this, it doesn't bring up any errors, but the button does not take the desired color. Any suggestions greatly appreciated!
EDIT:
thanks for the code, i copied it and run it, here is what i get: still a white button ..?
Upvotes: 0
Views: 7861
Reputation: 369274
Passing bg
keyword argument works as expected. Try following:
from Tkinter import *
root = Tk()
button = Button(root, text='buggton', bg='green')
button.grid(row=0, column=0)
root.mainloop()
Upvotes: 1