942,792 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 4359
  • Python RSS
Mar 3rd, 2008
0

button flash,progressbar

Expand Post »
have anyone ever create a progressbar using Tkinter and make button flash or place a picture on button.

is this possible with tkinter.
please can anyone tell me or show me how i can do these things???

thank you very much
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nish88 is offline Offline
46 posts
since Nov 2007
Mar 3rd, 2008
1

Re: button flash,progressbar

You can do it with label and use spaces of the desired background colour. Here is example:
python Syntax (Toggle Plain Text)
  1. # Tkinter progress bar experiment
  2. # using label and string of spaces
  3.  
  4. import Tkinter as tk
  5.  
  6. root = tk.Tk()
  7. # width 300 and height 100, no offsets
  8. root.geometry("300x100+0+0")
  9.  
  10. space = " "
  11. s = ""
  12. label = tk.Label(root, text=s, bg='blue')
  13. label.pack(anchor='nw')
  14.  
  15. for k in range(80):
  16. s += space
  17. # increments every 100 milliseconds
  18. label.after(100,label.config(text=s))
  19. label.update() # needed
  20.  
  21. root.mainloop()
Last edited by bumsfeld; Mar 3rd, 2008 at 1:18 pm. Reason: bg
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005
Mar 4th, 2008
0

Re: button flash,progressbar

thank you its good but i want that after the completion the progessbar disappear.
is it possible???
can you tel me how i can do it????

thank you in advance...
Reputation Points: 10
Solved Threads: 0
Light Poster
nish88 is offline Offline
46 posts
since Nov 2007
Mar 4th, 2008
0

Re: button flash,progressbar

You could do it with something like
label.config(bg='white')
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,789 posts
since Oct 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: How the while works in Python?
Next Thread in Python Forum Timeline: Newbie type trouble





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC