Tkinter GUI Application Development Blueprints

Master GUI programming in Tkinter as you design, implement, and deliver ten real-world applications from start to finish

Tkinter GUI Application Development Blueprints

This ebook is included in a Mapt subscription
Bhaskar Chaudhary

5 customer reviews
Master GUI programming in Tkinter as you design, implement, and deliver ten real-world applications from start to finish
$10.00
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook
Preview in Mapt

Book Details

ISBN 139781785889738
Paperback340 pages

Book Description

Tkinter is the built-in GUI package that comes with standard Python distributions. It is a cross-platform package, which means you build once and deploy everywhere. It is simple to use and intuitive in nature, making it suitable for programmers and non-programmers alike.

This book will help you master the art of GUI programming. It delivers the bigger picture of GUI programming by building real-world, productive, and fun applications such as a text editor, drum machine, game of chess, media player, drawing application, chat application, screen saver, port scanner, and many more. In every project, you will build on the skills acquired in the previous project and gain more expertise.

You will learn to write multithreaded programs, network programs, database driven programs and more. You will also get to know the modern best practices involved in writing GUI apps. With its rich source of sample code, you can build upon the knowledge gained with this book and use it in your own projects in the discipline of your choice.

Table of Contents

Chapter 1: Meet Tkinter
Objectives of this chapter
Installing Python and Tkinter
Importing Tkinter
GUI programming – the big picture
The root window – your drawing board
Widgets – the building blocks of GUI programs
The Tkinter geometry manager
Events and callbacks – adding life to programs
Handling widget-specific variables
Event unbinding and virtual events
Doing it in style
Some common root window options
Summary
Chapter 2: Making a Text Editor
Objectives of the chapter
An overview of the chapter
Setting up the editor skeleton
Adding a menu and menu items
Implementing the View menu
Adding a built-in functionality
Indexing and tagging
Implementing the Select All feature
Implementing the Find Text feature
Types of Toplevel windows
Working with forms and dialogs
Working with message boxes
The icons toolbar and View menu functions
Displaying the line number
Adding the cursor information bar
Adding themes
Creating the context/pop-up menu
Summary
Chapter 3: Programmable Drum Machine
An overview of the chapter
Module requirements for the chapter
Setting up the GUI in OOP
Finalizing the data structure
Creating broader visual elements
Loading drum samples
Playing the drum machine
Tkinter and threading
Support for multiple beat patterns
Saving beat patterns
Working with ttk-themed widgets
Summary
Chapter 4: A Game of Chess
An overview of the chapter
Structuring our program
Modeling the data structures
Creating a Piece class
Making the game functional
Managing user preferences
Summary
Chapter 5: Building an Audio Player
An overview of the chapter
External library requirements
Program structure and broadview skeleton
Deciding the data structure
Creating the Player class
Adding and removing items from a playlist
Playing audio and adding audio controls
Creating a seek bar
One-time updates during audio playback
Managing continuous updates
Looping over tracks
Adding a tooltip
Summary
Chapter 6: Paint Application
Creating a tiny framework
Setting up a broad GUI structure
Dealing with mouse events
Adding toolbar buttons
Drawing items on the canvas
Adding a color palette
Adding top bar options for draw methods
Drawing irregular lines and super shapes
Adding functionality to the remaining buttons
Adding functionality to menu items
Summary
Chapter 7: Multiple Fun Projects
Chapter objectives
Building a screen saver
Building a Snake game
Creating a Weather Reporter
Creating a phone book application
Graphing with Tkinter
3D graphics with Tkinter
Summary
Chapter 8: Miscellaneous Tips
Chapter objectives
Tracing Tkinter variables
Widget traversal
Validating user input
Formatting widget data
More on fonts
Redirecting the command-line output to Tkinter
The class hierarchy of Tkinter
Tips for program design
Tips for program optimization
Distributing a Tkinter application
The limitations of Tkinter
Tkinter in Python 2.x
Summary

What You Will Learn

  • Get to know the basic concepts of GUI programming, such as Tkinter top-level widgets, geometry management, event handling, using callbacks, custom styling, and dialogs
  • Create apps that can be scaled in size or complexity without breaking down the core
  • Write your own GUI framework for maximum code reuse
  • Build apps using both procedural and OOP styles, understanding the strengths and limitations of both styles
  • Learn to structure and build large GUI applications based on Model-View-Controller (MVC) architecture
  • Build multithreaded and database-driven apps
  • Create apps that leverage resources from the network
  • Learn basics of 2D and 3D animation in GUI applications
  • Develop apps that can persist application data with object serialization and tools such as configparser

Authors

Table of Contents

Chapter 1: Meet Tkinter
Objectives of this chapter
Installing Python and Tkinter
Importing Tkinter
GUI programming – the big picture
The root window – your drawing board
Widgets – the building blocks of GUI programs
The Tkinter geometry manager
Events and callbacks – adding life to programs
Handling widget-specific variables
Event unbinding and virtual events
Doing it in style
Some common root window options
Summary
Chapter 2: Making a Text Editor
Objectives of the chapter
An overview of the chapter
Setting up the editor skeleton
Adding a menu and menu items
Implementing the View menu
Adding a built-in functionality
Indexing and tagging
Implementing the Select All feature
Implementing the Find Text feature
Types of Toplevel windows
Working with forms and dialogs
Working with message boxes
The icons toolbar and View menu functions
Displaying the line number
Adding the cursor information bar
Adding themes
Creating the context/pop-up menu
Summary
Chapter 3: Programmable Drum Machine
An overview of the chapter
Module requirements for the chapter
Setting up the GUI in OOP
Finalizing the data structure
Creating broader visual elements
Loading drum samples
Playing the drum machine
Tkinter and threading
Support for multiple beat patterns
Saving beat patterns
Working with ttk-themed widgets
Summary
Chapter 4: A Game of Chess
An overview of the chapter
Structuring our program
Modeling the data structures
Creating a Piece class
Making the game functional
Managing user preferences
Summary
Chapter 5: Building an Audio Player
An overview of the chapter
External library requirements
Program structure and broadview skeleton
Deciding the data structure
Creating the Player class
Adding and removing items from a playlist
Playing audio and adding audio controls
Creating a seek bar
One-time updates during audio playback
Managing continuous updates
Looping over tracks
Adding a tooltip
Summary
Chapter 6: Paint Application
Creating a tiny framework
Setting up a broad GUI structure
Dealing with mouse events
Adding toolbar buttons
Drawing items on the canvas
Adding a color palette
Adding top bar options for draw methods
Drawing irregular lines and super shapes
Adding functionality to the remaining buttons
Adding functionality to menu items
Summary
Chapter 7: Multiple Fun Projects
Chapter objectives
Building a screen saver
Building a Snake game
Creating a Weather Reporter
Creating a phone book application
Graphing with Tkinter
3D graphics with Tkinter
Summary
Chapter 8: Miscellaneous Tips
Chapter objectives
Tracing Tkinter variables
Widget traversal
Validating user input
Formatting widget data
More on fonts
Redirecting the command-line output to Tkinter
The class hierarchy of Tkinter
Tips for program design
Tips for program optimization
Distributing a Tkinter application
The limitations of Tkinter
Tkinter in Python 2.x
Summary

Book Details

ISBN 139781785889738
Paperback340 pages
Read More
From 5 reviews

Read More Reviews