Tkinter GUI Application Development Blueprints - Second Edition

Tkinter GUI Application Development Blueprints - Second Edition

Build nine projects by working with widgets, geometry management, event handling, and more

暂无评价综合评分的显示会考虑用户真实性等多项因素,每部作品出现综合评分的时间不定。

作品简介

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, audio player, drawing application, piano tutor, chat application, screen saver, port scanner, and much 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, asyncio based programming 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.

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.

作品目录

  1. Copyright and Credits
  2. Packt Upsell
  3. Why subscribe?
  4. PacktPub.com
  5. Contributors
  6. About the author
  7. About the reviewer
  8. Packt is searching for authors like you
  9. Preface
  10. Who this book is for
  11. What this book covers
  12. To get the most out of this book
  13. Get in touch
  14. Meet Tkinter
  15. Technical requirements
  16. Project overview
  17. Getting started
  18. GUI programming – the big picture
  19. The root window – your drawing board
  20. Widgets – the building blocks of GUI programs
  21. The Tkinter geometry manager
  22. Events and callbacks – adding life to programs
  23. Handling widget-specific variables
  24. Event unbinding and virtual events
  25. Doing it in style
  26. Some common root window options
  27. Getting interactive help
  28. Summary
  29. QA section
  30. Further reading
  31. Making a Text Editor
  32. Project overview
  33. Getting started – setting up the editor skeleton
  34. Adding a menu and menu items
  35. Implementing the View menu
  36. Adding a built-in functionality
  37. Indexing and tagging
  38. Implementing the Select All feature
  39. Implementing the Find Text feature
  40. Types of Toplevel window
  41. Working with forms and dialogs
  42. Working with message boxes
  43. The icons toolbar and View menu functions
  44. Displaying line numbers
  45. Adding the cursor information bar
  46. Adding themes
  47. Creating a context/pop-up menu
  48. Summary
  49. QA section
  50. Further reading
  51. Programmable Drum Machine
  52. Getting started
  53. Technical requirements
  54. Setting up the GUI in OOP
  55. Finalizing the data structure
  56. Creating broader visual elements
  57. Defining getter and setter methods
  58. The number of units and beats per unit features
  59. Loading drum samples
  60. Playing the drum machine
  61. Tkinter and threading
  62. Support for multiple beat patterns
  63. Saving beat patterns
  64. Working with ttk-themed widgets
  65. Summary
  66. QA section
  67. Further reading
  68. Game of Chess
  69. An overview of the chapter
  70. Module requirements for this chapter
  71. Structuring our program
  72. Modeling the data structure
  73. Creating a Piece class
  74. Making the game functional
  75. Managing user preferences
  76. Summary
  77. QA section
  78. Further reading
  79. Building an Audio Player
  80. An overview of the chapter
  81. External library requirements
  82. Program structure and broadview skeleton
  83. Deciding the data structure
  84. Creating the Player class
  85. Adding and removing items from a playlist
  86. Playing audio and adding audio controls
  87. Creating a seek bar
  88. One-time updates during audio playback
  89. Managing continuous updates
  90. Looping over tracks
  91. Adding a tooltip
  92. Summary
  93. QA section
  94. Further reading
  95. Paint Application
  96. Overview of the application
  97. Creating a tiny framework
  98. Setting up a broad GUI structure
  99. Dealing with mouse events
  100. Adding toolbar buttons
  101. Drawing items on the canvas
  102. Adding a color palette
  103. Adding top bar options for draw methods
  104. Drawing irregular lines and super shapes
  105. Adding functionality to the remaining buttons
  106. Adding functionality to menu items
  107. Summary
  108. QA section
  109. Further reading
  110. Piano Tutor
  111. Technical requirements
  112. A brief primer on piano terms
  113. Building the broad GUI structure
  114. Making the piano keyboard
  115. Playing audio
  116. Building the scales tutor
  117. Building the chord finder section
  118. Building the chord progression tutor
  119. Building the score maker
  120. A note on window responsiveness
  121. Summary
  122. QA section
  123. Further reading
  124. Fun with Canvas
  125. Building a screen saver
  126. Graphing with Tkinter
  127. Gravity simulation
  128. Drawing fractals
  129. Voronoi diagrams
  130. Spring pendulum simulation
  131. Chaos game – building triangles out of randomness
  132. Phyllotaxy
  133. 3D graphics with Tkinter
  134. Summary
  135. QA section
  136. Further reading
  137. Multiple Fun Projects
  138. Technical requirements
  139. Building a Snake game
  140. Creating a Weather Reporter application
  141. A simple socket demo
  142. Building a port scanner
  143. Building a chat application
  144. Creating a phone book application
  145. Using asyncio with Tkinter
  146. Interfacing with hardware/serial communication
  147. Summary
  148. QA section
  149. Further reading
  150. Miscellaneous Tips
  151. Tracing Tkinter variables
  152. Widget traversal
  153. Validating user input
  154. Formatting widget data
  155. More on fonts
  156. Redirecting the command-line output to Tkinter
  157. The class hierarchy of Tkinter
  158. Tips for program design
  159. Handling cross-platform differences 
  160. Tips for program optimization
  161. Distributing a Tkinter application
  162. The limitations of Tkinter
  163. Alternatives to Tkinter
  164. Tkinter in Python 2.x
  165. Summary
  166. QA section
  167. Other Books You May Enjoy
  168. Leave a review - let other readers know what you think