User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 391,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,639 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 729 | Replies: 2 | Solved
Reply
Join Date: Oct 2006
Location: New York City
Posts: 2,553
Reputation: mattyd is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 1
Featured Poster
mattyd's Avatar
mattyd mattyd is offline Offline
Posting Maven

Button Binding Question:

  #1  
Jan 1st, 2007
Simply, I need to understand the basics of button binding. I have researched this already and have decided just to ask for instruction.

For example, one of the programs I am building currently will require, at a certain point, user input; I want to be able to know when a button has been pushed. I think I will have to use "<Button-1>" but I am not entirely sure of the rest of the necessary code needed to do so. I do not quite understand the syntax. What I have tried thus far has not worked.

The following is a snip of a button code (no use of binding) from the current Py project:

btn1 = Button(root ,bg="Black", text="HIT",    image=image01,command=show_image2)
btn1.configure(state=NORMAL,background='red' )
btn1.pack() 

Any help would be greatly appreciated as it would put me close to finishing my build.

Thank-you.

sharky_machine
Last edited by mattyd : Jan 1st, 2007 at 3:34 am. Reason: sp
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: New York City
Posts: 2,553
Reputation: mattyd is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 1
Featured Poster
mattyd's Avatar
mattyd mattyd is offline Offline
Posting Maven

Re: Button Binding Question:

  #2  
Jan 1st, 2007
Originally Posted by sharky_machine View Post
Simply, I need to understand the basics of button binding. I have researched this already and have decided just to ask for instruction.

For example, one of the programs I am building currently will require, at a certain point, user input; I want to be able to know when a button has been pushed. I think I will have to use "<Button-1>" but I am not entirely sure of the rest of the necessary code needed to do so. I do not quite understand the syntax. What I have tried thus far has not worked.

The following is a snip of a button code (no use of binding) from the current Py project:

btn1 = Button(root ,bg="Black", text="HIT",    image=image01,command=show_image2)
btn1.configure(state=NORMAL,background='red' )
btn1.pack() 

Any help would be greatly appreciated as it would put me close to finishing my build.

Thank-you.

sharky_machine


I figured it out
Reply With Quote  
Join Date: Oct 2006
Posts: 1,159
Reputation: sneekula is on a distinguished road 
Rep Power: 4
Solved Threads: 37
sneekula's Avatar
sneekula sneekula is offline Offline
Veteran Poster

Re: Button Binding Question:

  #3  
Jan 2nd, 2007
So, how did you solve the problem?

BTW, I really enjoyed reading your blogs!
Last edited by sneekula : Jan 2nd, 2007 at 2:01 am.
No one died when Clinton lied.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Python Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 9:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC