Creating a Highly Customizable Python Editor

The next project we will be undertaking is a smart text editor for writing Python code. This text editor will have all of the features you would normally expect a text editor to have, including line numbers, a top menu bar, a right-click menu, various customizable key-bindings, a find/replace window, configurable syntax highlighting, and more!

Our first iteration will set up the foundations for our editor. We will start with the basic layout, some of the least complicated and familiar widgets, some key-bindings, and the creation of our find window.

In this chapter, we will cover:

  • Using themed ttk widgets instead of regular tk ones
  • Styling tk and ttk widgets
  • Handling a large amount of text with the Text widget
  • Scrolling with the Scrollbar widget
  • Tkinter's event system
  • Creating a second top-level window

With the increase in complexity of this new project, we should also ensure it looks as professional as possible. In order to improve the look and feel of our text editor, we will move on from Tkinter's stock widgets to those provided by a submodule named ttk. These will give our editor a much more native feel to the user. So, what is the ttk submodule?

..................Content has been hidden....................

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