473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How the Lable binds the button without any flirking or jumping?

1
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 = "#000000008800"
GRN = "#009900"
# create a toolbar
toolbar = Frame(root, width=10, height=1, bg='white')
toolbar.pack(expand=YES, fill=BOTH)

b = Button(toolbar, text="", width=6, height=1, relief='raised',bd=8, bg=BLU,fg='white',font=('Arial', 14), command=callback)
b.pack(side=LEFT, padx=30,expand=YES, fill=NONE)
b.bind('<Button>', cool)

c = Label(b, text = 'Number:' , fg='white', font=('Arial',14))
c.config(width=6, height=1, bg=BLU)
c.pack(expand=NO, fill=BOTH, side=TOP)
c.bind('<Button>', cool)

d = Label(b, text = '3' , fg=GRN, font=('Arial',14))
d.config(width=6, height=1, bg=BLU)
d.pack(expand=NO, fill=BOTH, side=TOP)
d.bind('<Button>', cool)

f = Button(toolbar, text="", width=6, height=1, relief='raised',bd=8, bg=BLU,fg='white',font=('Arial', 14), command=callback)
f.pack(side=RIGHT, padx=20, pady=20)
f.bind('<Button>')

g = Label(f, text = 'Number:' , fg='white', font=('Arial',14))
g.config(width=6, height=1, bg=BLU)
g.pack(expand=NO, fill=BOTH, side=TOP)
g.bind('<Button>')

h = Label(f, text = '0' , fg=GRN, font=('Arial',14))
h.config(width=6, height=1, bg=BLU)
h.pack(expand=NO, fill=BOTH, side=TOP)
h.bind('<Button>')

toolbar.pack(side=TOP, fill=X)


mainloop()
###########################################
Sep 26 '05 #1
0 1597

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Symphony | last post by:
Hi, All: I am using vb.net developing web application. I am new in web application. My issue is: I have a button "btnCalculateTotal" on a web page (form), click this button, the...
4
by: Pieter Linden | last post by:
In Access 2000, I would have sworn I could see the controltiptext of a button without clicking on it. Can this still be done in AccessXP? If so, does someone have a code snippet showing how to do...
2
by: Phillip Kennedy | last post by:
Hi, HELP!!!! we are having a problem where we have a web page with a number of buttons and form fields, unfortunately whenevr we hit the enter key in a form field it is envokingthe 1st button,...
4
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer...
2
by: mwatcher | last post by:
Hi all, I am using .net 2.0. How can I get the current state of the mouse button (e.g.. Mouse Button Right is pressed). I'm not in a mouse event handler routine. What I wanna do is to check if...
0
by: miner49er | last post by:
Hello, I'm trying to implement a c# on-screen keyboard for use with a touch screen. I'm having a problem with focus though, I have tried several things, but nothing works yet! I need to stop...
1
by: wtfxxx | last post by:
Hi i've a keyboard based UI that needs to give focus to a radio button but not select it until the user presses a key (Enter most likely). But unfortunately Focus and Selecting are bound...
1
by: balakrishnan.dinesh | last post by:
Hi frndz , I want to assgin value to <input type=file, without clicking browse button , And i know that it is readonly , But how it is possible in Firfox browsers ?.. Is there any...
2
by: sajankonni | last post by:
i want to refresh image buttons in asp.net,only without reloading the entire page.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.