I have a question regarding on the button and label.
i don't know why when the mouse cursor points on the button, i see the button is flirking. is there anyway to make it not behave like that?
because i want to highlight the text above the button when i click on it.
can anyone help me out . Thank You
the code is following:
############### ############### ##############
# File: toolbar1.py
from Tkinter import *
root = Tk()
def callback():
print "called the callback!"
def cool():
destroy()
BLU = "#000000008 800"
GRN = "#009900"
# create a toolbar
toolbar = Frame(root, width=10, height=1, bg='white')
toolbar.pack(ex pand=YES, fill=BOTH)
b = Button(toolbar, text="", width=6, height=1, relief='raised' ,bd=8, bg=BLU,fg='whit e',font=('Arial ', 14), command=callbac k)
b.pack(side=LEF T, padx=30,expand= YES, fill=NONE)
b.bind('<Button >', cool)
c = Label(b, text = 'Number:' , fg='white', font=('Arial',1 4))
c.config(width= 6, height=1, bg=BLU)
c.pack(expand=N O, fill=BOTH, side=TOP)
c.bind('<Button >', cool)
d = Label(b, text = '3' , fg=GRN, font=('Arial',1 4))
d.config(width= 6, height=1, bg=BLU)
d.pack(expand=N O, fill=BOTH, side=TOP)
d.bind('<Button >', cool)
f = Button(toolbar, text="", width=6, height=1, relief='raised' ,bd=8, bg=BLU,fg='whit e',font=('Arial ', 14), command=callbac k)
f.pack(side=RIG HT, padx=20, pady=20)
f.bind('<Button >')
g = Label(f, text = 'Number:' , fg='white', font=('Arial',1 4))
g.config(width= 6, height=1, bg=BLU)
g.pack(expand=N O, fill=BOTH, side=TOP)
g.bind('<Button >')
h = Label(f, text = '0' , fg=GRN, font=('Arial',1 4))
h.config(width= 6, height=1, bg=BLU)
h.pack(expand=N O, fill=BOTH, side=TOP)
h.bind('<Button >')
toolbar.pack(si de=TOP, fill=X)
mainloop()
############### ############### #############
i don't know why when the mouse cursor points on the button, i see the button is flirking. is there anyway to make it not behave like that?
because i want to highlight the text above the button when i click on it.
can anyone help me out . Thank You
the code is following:
############### ############### ##############
# File: toolbar1.py
from Tkinter import *
root = Tk()
def callback():
print "called the callback!"
def cool():
destroy()
BLU = "#000000008 800"
GRN = "#009900"
# create a toolbar
toolbar = Frame(root, width=10, height=1, bg='white')
toolbar.pack(ex pand=YES, fill=BOTH)
b = Button(toolbar, text="", width=6, height=1, relief='raised' ,bd=8, bg=BLU,fg='whit e',font=('Arial ', 14), command=callbac k)
b.pack(side=LEF T, padx=30,expand= YES, fill=NONE)
b.bind('<Button >', cool)
c = Label(b, text = 'Number:' , fg='white', font=('Arial',1 4))
c.config(width= 6, height=1, bg=BLU)
c.pack(expand=N O, fill=BOTH, side=TOP)
c.bind('<Button >', cool)
d = Label(b, text = '3' , fg=GRN, font=('Arial',1 4))
d.config(width= 6, height=1, bg=BLU)
d.pack(expand=N O, fill=BOTH, side=TOP)
d.bind('<Button >', cool)
f = Button(toolbar, text="", width=6, height=1, relief='raised' ,bd=8, bg=BLU,fg='whit e',font=('Arial ', 14), command=callbac k)
f.pack(side=RIG HT, padx=20, pady=20)
f.bind('<Button >')
g = Label(f, text = 'Number:' , fg='white', font=('Arial',1 4))
g.config(width= 6, height=1, bg=BLU)
g.pack(expand=N O, fill=BOTH, side=TOP)
g.bind('<Button >')
h = Label(f, text = '0' , fg=GRN, font=('Arial',1 4))
h.config(width= 6, height=1, bg=BLU)
h.pack(expand=N O, fill=BOTH, side=TOP)
h.bind('<Button >')
toolbar.pack(si de=TOP, fill=X)
mainloop()
############### ############### #############