Reader small image

You're reading from  Tkinter GUI Application Development Blueprints

Product typeBook
Published inNov 2015
Reading LevelExpert
PublisherPackt
ISBN-139781785889738
Edition1st Edition
Languages
Right arrow
Author (1)
Bhaskar Chaudhary
Bhaskar Chaudhary
author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary

Right arrow

The icons toolbar and View menu functions


In this iteration, we will add the following functionalities to the text editor:

  • Showing the shortcut icons on the toolbar

  • Displaying line numbers

  • Highlighting the current line

  • Changing the color theme of the editor

Let's start with a simple task first. In this step, we will add shortcut icons to the toolbar as shown in the following screenshot:

You may recall that we have already created a frame to hold these icons. Let's add these icons now.

While adding these icons, we have followed a convention. The icons have been named exactly the same as the corresponding function that handles them. Following this convention has enabled us to loop through a list, simultaneously apply the icon image to each button, and add the command callback from within the loop. All the icons have been placed in the icons folder.

The following code adds an icon (refer to 2.10.py in the code bundle):

icons = ('new_file', 'open_file', 'save', 'cut', 'copy', 'paste', 'undo', 'redo'...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Tkinter GUI Application Development Blueprints
Published in: Nov 2015Publisher: PacktISBN-13: 9781785889738

Author (1)

author image
Bhaskar Chaudhary

Bhaskar Chaudhary is a professional programmer and information architect. He has a decade of experience in consulting, contracting, and educating in the field of software development. He has worked with a large set of programming languages on various platforms over the years. He is an electronics hobbyist and a musician in his free time.
Read more about Bhaskar Chaudhary