Chapter 2. Making a Text Editor like Notepad

In the previous project, we got a fairly high-level overview of Tkinter. Now that we know some things about Tkinter's core widgets, geometry management, and bindings of command and events to callbacks, let us apply our skill to make a text editor in this project.

In the process, we will also take a closer look at individual widgets and learn how to tweak those widgets to our custom needs.

Mission Briefing

In this project, our goal is to build a fully-functional text editing pad with some cool nifty features. In its final form, the proposed editor should look as follows:

Mission Briefing

Some features we intend to include in the notepad are:

  • Creating new documents, opening and editing existing documents, and saving documents
  • Implementing common editing options such as cut, copy, paste, undo, and redo
  • Searching within a file for a given search term
  • Implementing line numbering and the ability to show/hide line numbers
  • Implementing theme selection to let the user choose custom color themes
  • Implementing about and help windows and more

Why Is It Awesome?

In this project you will build you first real and useful project. This project will provide you with further insights into the world of Tkinter. It will delve deeper into features of some commonly used widgets such as Menu, Menubutton, Text, Entry, Checkbutton, and Button widgets.

Particularly, we will go into the finer details of the Menu, Menubar, and Text widgets. We will also learn to easily handle custom dialogs windows such as the Open, Save, Error, Warning, and Info dialogs.

Your Hotshot Objectives

The project will be developed in seven consecutive iterations. The goals for each of these iterations are as follows:

  • Set the user interface using the pack geometry using widgets such as Menu, Menubar, Text, Entry, Button, Checkbutton, and the like
  • Implement some features using Tkinter's built-in widget options
  • Implement dialogs using ttk dialogs and different types of Toplevel widgets
  • Apply some Text widget features such as text index, tag, and mark to implement some custom features
  • Apply some features using the Checkbutton and Radiobutton widgets
  • Apply some custom event binding and protocol binding to make the application more user-friendly
  • Add some miscellaneous features
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.30.210