Code in Python
Machine Learning and Deep Learning Blogs
search

Learn How to add a Status bar in Tkinter

In the previous chapter, we learned how to make toolbar and drop down menus. In this chapter, we will learn how to make a status bar. It is just a text written on the bottom of the window that shows the status of the file on which you are working on or any other thing. To add a status bar, make a label first.

status = Label(var, text="processing…", bd=1, relief=SUNKEN, anchor=W) 

In the label, first, we will specify where we have to put the status bar. Here, we have one window so we are using var. The text is used to specify the text to be shown on the label. Bd is used for the border. Whenever we create a label, we can add border to it.

Relief is a parameter that allows us to manage how we want our label to appear. Here, we want it to appear sunken in our screen.  If we add just a label at the bottom of the screen, it looks kind of weird, but if we have border and relief, it looks like a part of the window.

Anchor allow us to decide where the label should be pinned. W is used for the West, N is for North, E is for East and S is for South. We want to show it on the left side of the screen so we have used W. Now, to show this status bar in our main window, we need to pack it up.

status.pack(side=BOTTOM, fill=X) 

The status bar will be displayed on the bottom of the window and it will cover the horizontal part of the screen no matter how much we stretch it.

Final Code – Status bar

Complete program for the status bar is,

from tkinter import *
var = Tk()

status = Label(var, text="processing…", bd=1, relief=SUNKEN, anchor=W)
status.pack(side=BOTTOM, fill=X)

var.mainloop() 

status bar

Rahul Choudhary
Follow me

Rahul Choudhary

Rahul is a Python enthusiast. He likes to explore whatever is new in Python world. Rahul is a car fanatic and a serial chiller. Follow him on Facebook and Twitter.
Rahul Choudhary
Follow me

Latest posts by Rahul Choudhary (see all)

42 Comments

  1. I discovered your weblog website on google and test a few of your early posts. Continue to keep up the superb operate. I simply extra up your RSS feed to my MSN Information Reader. Seeking ahead to reading more from you in a while!…

  2. Woah! I’m really digging the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s challenging
    to get that “perfect balance” between user friendliness and appearance.
    I must say that you’ve done a awesome job with this.
    Also, the blog loads super quick for me on Internet explorer.
    Superb Blog!

  3. Nice blog here! Also your web site loads up very fast!

    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as quickly as yours lol

  4. Quality posts is the main to interest the users to pay a quick visit
    the web site, that’s what this website is providing.

  5. If some one desires to be updated with hottest technologies
    after that he must be pay a quick visit this web site and be
    up to date daily.

  6. I read this post completely about the difference of hottest and earlier technologies,
    it’s remarkable article.

  7. Thhanks for this interesting post, I have shared it on Twitter.

  8. I do accept as true with all of the ideas you have offered on your post.
    They’re really convincing and can definitely work. Still,
    the posts are too short for novices. Could you please lengthen them a little
    from next time? Thank you for the post.

  9. Hurrah! Finally I got a web site from where I know how to in fact get helpful facts regarding my study
    and knowledge.

  10. Hey there just wanted to give you a quick heads up and let you know a few of
    the images aren’t loading correctly. I’m not sure why but I think its a linking issue.

    I’ve tried it in two different web browsers and both show the same outcome.

  11. Everything is very open with a precise description of the
    challenges. It was truly informative. Your website is very helpful.
    Thank you for sharing!

  12. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

    You clearly know what youre talking about, why waste
    your intelligence on just posting videos to your blog when you could be giving us something informative
    to read?

  13. You should take part in a contest for one of the best sites on the
    net. I’m going to highly recommend this web site!

  14. Have you ever considered about adding a little bit more
    than just your articles? I mean, what you say is fundamental and all.
    Nevertheless imagine if you added some great pictures or video clips to
    give your posts more, “pop”! Your content is excellent
    but with images and clips, this site could definitely be one of the greatest in its
    niche. Amazing blog!

  15. I think this is one of the most vital information for me.
    And i’m glad reading your article. But wanna remark on few general things, The website
    style is wonderful, the articles is really nice : D. Good job,
    cheers

  16. Remarkable! Its truly awesome post, I have got much clear idea about from this post.

  17. It’s a pity you don’t have a donate button! I’d definitely donate to this fantastic blog!
    I suppose for now i’ll settle for bookmarking
    and adding your RSS feed to my Google account. I look
    forward to new updates and will share this blog with my Facebook group.
    Chat soon!

  18. Very good info. Lucky me I came across your website by
    chance (stumbleupon). I’ve saved it for later!

  19. No matter if some one searches for his required
    thing, thus he/she wishes to be available that in detail, so that thing is maintained over here.

  20. My spouse and I stumbled over here by a different page
    and thought I should check things out. I like what I see so now i am
    following you. Look forward to looking over your web page repeatedly.

  21. Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your further post thanks once again.

  22. If you want to take much from this paragraph then you have to apply such strategies to your
    won webpage.

    belöning engelska

  23. That is very interesting, You are a very professional blogger.

    I’ve joined your feed and look ahead to searching
    for extra of your wonderful post. Additionally, I’ve shared your website in my
    social networks

  24. I read this paragraph completely regarding the
    difference of most up-to-date and earlier technologies, it’s remarkable article.

  25. Hi, for all time i used to check weblog posts here early in the break of day, since i
    enjoy to find out more and more.

  26. I savor, cause I discovered exactly what I was taking
    a look for. You have ended my four day long hunt!
    God Bless you man. Have a great day. Bye

  27. Hi there! Would you mind if I share your blog with my twitter group?
    There’s a lot of folks that I think would really enjoy your content.
    Please let me know. Thank you

  28. Fine way of describing, and good article to take data concerning my presentation topic, which i am
    going to convey in institution of higher education.

  29. Today, I went to the beach front with my children. I found
    a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
    She put the shell to her ear and screamed. There was a hermit crab
    inside and it pinched her ear. She never wants to go back!
    LoL I know this is entirely off topic but I had to tell someone!

  30. I’m really impressed together with your writing skills as smartly as with the format on your blog.
    Is that this a paid theme or did you customize it yourself?

    Anyway stay up the nice quality writing, it is
    uncommon to see a great weblog like this one these
    days..

  31. What’s Happening i’m new to this, I stumbled upon this I’ve discovered
    It positively useful and it has aided me out loads. I am hoping to contribute & help different
    customers like its helped me. Good job.

  32. I always used to study post in news papers but now as I am a user of internet therefore from now I am using net for content,
    thanks to web.

  33. naturally like your web site but you need to test
    the spelling on several of your posts. Many of them are rife with spelling problems and I in finding it very bothersome to
    inform the reality nevertheless I’ll certainly come again again.

  34. Great looking web site. Think you did a great deal of your very own coding.

  35. Admiring the dedication you put into your website and
    detailed information you present. It’s good to come across a blog every once in a while that
    isn’t the same out of date rehashed information. Great read!
    I’ve saved your site and I’m including your RSS feeds to my Google account.

  36. Hey! Do you know if they make any plugins to protect against hackers?
    I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?

  37. Wow, this article is pleasant, my sister is analyzing these kinds of things,
    therefore I am going to convey her.

2 Pingbacks

  1. Google
  2. Google

Leave a Reply

Your email address will not be published.

*

© 2018 Code in Python