O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding the cursor information bar

The cursor information bar is simply a small label at the bottom-right corner of the Text widget that displays the current position of the cursor, as shown in the following screenshot:

The user can choose to show/hide this info bar from the View menu (2.11.py).

Begin by creating a Label widget within the Text widget and pack it in the bottom-right corner, as follows:

cursor_info_bar = Label(content_text, text='Line: 1 | Column: 1')cursor_info_bar.pack(expand=NO, fill=None, side=RIGHT, anchor='se')

In many ways, this is similar to displaying line numbers. Here, too, the positions must be calculated after every ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required