Tkinter GUI Application Development Cookbook
图书信息
| 作者 | Alejandro Rodas de Paz |
| 出版社 | Packt Publishing |
| ISBN | 9781788627771 |
| 出版时间 | 2018-03-30 |
| 字数 | 24.7万 |
| 分类 | 进口书,外文原版书,电脑,网络 |
读书简介
Discover solutions to all your Tkinter and Python GUI development problems About This Book ? Integrate efficient Python GUI programming techniques with Tkinter ? Efficiently implement advanced MVC architectures in your Python GUI apps ? Solve all your problems related to Tkinter and Python GUI development Who This Book Is For This book is for Python developers who are familiar with the basics of the language syntax, data structures, and OOP. You do not need previous experience with Tkinter or other GUI development libraries. What You Will Learn ? Add widgets and handle user events ? Lay out widgets within windows using frames and the different geometry managers ? Configure widgets so that they have a customized appearance and behavior ? Improve the navigation of your apps with menus and dialogs ? Apply object-oriented programming techniques in Tkinter applications ? Use threads to achieve responsiveness and update the GUI ? Explore the capabilities of the canvas widget and the types of items that can be added to it ? Extend Tkinter applications with the TTK (themed Tkinter) module In Detail As one of the more versatile programming languages, Python is well-known for its batteries-included philosophy, which includes a rich set of modules in its standard library; Tkinter is the library included for building desktop applications. Due to this, Tkinter is a common choice for rapid GUI development, and more complex applications can benefit from the full capabilities of this library. This book covers all of your Tkinter and Python GUI development problems and solutions. Tkinter GUI Application Development Cookbook starts with an overview of Tkinter classes and at the same time provides recipes for basic topics, such as layout patterns and event handling. Next, we cover how to develop common GUI patterns, such as entering and saving data, navigating through menus and dialogs, and performing long-running actions in the background. You will then make your apps leverage network resources effectively, perform 2D and 3D animation-related tasks, create 3D objects, and perform advanced graphical operations. Finally, this book covers using the canvas and themed widgets. By the end of the book, you will have an in-depth knowledge of Tkinter classes, and will know how to use them to build efficient and rich GUI applications. Style and approach A practical recipe-based guide that will help you find solutions to all your Tkinter and Python GUI development-related problems.
目录
Title Page
Copyright and Credits
Tkinter GUI Application Development Cookbook
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Getting Started with Tkinter
Introduction
Structuring a Tkinter application
Getting ready
How to do it...
How it works...
There's more...
Working with buttons
How to do it...
How it works...
There's more...
Creating text entries
How to do it...
How it works...
There's more...
See also
Tracing text changes
How to do it...
How it works...
There's more...
See also
Validating a text entry
How to do it...
How it works...
There's more...
See also
Selecting numerical values
How to do it...
How it works...
There's more...
See also
Creating selections with radio buttons
How to do it...
How it works...
There's more...
Implementing switches with checkboxes
How to do it...
How it works...
There's more...
See also
Displaying a list of items
How to do it...
How it works...
There's more...
See also
Handling mouse and keyboard events
How to do it...
How it works...
There's more...
See also
Setting the main window's icon, title, and size
How to do it...
How it works...
There's more...
Window Layout
Introduction
Grouping widgets with frames
Getting ready
How to do it…
How it works…
There's more…
See also
Using the Pack geometry manager
Getting ready
How to do it…
How it works…
There's more…
See also
Using the Grid geometry manager
Getting ready
How to do it…
How it works…
There's more…
See also
Using the Place geometry manager
Getting ready
How to do it…
How it works…
There's more…
See also
Grouping inputs with the LabelFrame widget
Getting ready
How to do it…
How it works…
Dynamically laying out widgets
Getting ready
How to do it…
How it works…
Creating horizontal and vertical scrollbars
Getting ready
How to do it…
How it works…
There's more…
See also
Customizing Widgets
Introduction
Working with colors
Getting ready
How to do it...
How it works...
There's more...
Setting widget fonts
Getting ready
How to do it...
How it works...
There's more...
See also
Using the options database
Getting ready
How to do it...
How it works...
There's more...
See also
Changing the cursor icon
Getting ready
How to do it...
How it works...
There's more...
Introducing the Text widget
Getting ready
How to do it...
How it works...
Adding tags to the Text widget
Getting ready
How to do it...
How it works...
There's more...
See also
Dialogs and Menus
Introduction
Showing alert dialogs
Getting ready
How to do it...
How it works...
Asking for user confirmation
Getting ready
How to do it...
How it works...
Choosing files and directories
Getting ready
How to do it...
How it works...
There's more...
Saving data into a file
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a menu bar
Getting ready
How to do it...
How it works...
Using variables in menus
Getting ready
How to do it...
How it works...
Displaying context menus
Getting ready
How to do it...
How it works...
There's more...
Opening a secondary window
Getting ready
How to do it...
How it works...
Handling window deletion
Getting ready
How to do it...
How it works...
There's more...
Passing variables between windows
Getting ready
How to do it...
How it works...
Object-Oriented Programming and MVC
Introduction
Structuring our data with a class
Getting ready
How to do it...
How it works...
There's more...
Composing widgets to display information
Getting ready
How to do it...
How it works...
Reading records from a CSV file
Getting ready
How to do it...
How it works...
Persisting data into a SQLite database
Getting ready
How to do it...
How it works...
See also
Refactoring using the MVC pattern
Getting ready
How to do it...
How it works...
There's more...
Asynchronous Programming
Introduction
Scheduling actions
Getting ready
How to do it...
How it works...
There's more...
See also
Running methods on threads
How to do it...
How it works...
There's more...
Thread methods - start, run, and join
Parameterizing the target method
Performing HTTP requests
Getting ready
How to do it...
How it works...
See also
Connecting threads with a progress bar
Getting ready
How to do it...
How it works...
See also
Canceling scheduled actions
Getting ready
How to do it...
How it works...
There's more...
Handling idle tasks
Getting ready
How to do it...
How it works...
Spawning separate processes
Getting ready
How to do it...
How it works...
Canvas and Graphics
Introduction
Understanding the coordinate system
How to do it...
How it works...
There's more...
Drawing lines and arrows
Getting ready
How to do it...
How it works...
Writing text on a canvas
Getting ready
How to do it...
How it works...
There's more...
Placing the text by its upper-left corner
Setting line wrapping
Adding shapes to the canvas
Getting ready
How to do it...
How it works...
See also
Finding items by their position
Getting ready
How to do it...
How it works...
Moving canvas items
How to do it...
How it works...
There's more...
See also
Detecting collisions between items
Getting ready
How to do it...
How it works...
There's more...
Deleting items from a canvas
Getting ready
How to do it...
How it works...
Binding events to canvas items
Getting ready
How to do it...
How it works...
There's more...
See also
Rendering a canvas into a PostScript file
How to do it...
How it works...
There's more...
Themed Widgets
Introduction
Replacing basic widget classes
Getting ready
How to do it...
How it works...
See also
Creating an editable drop-down with Combobox
Getting ready
How to do it...
How it works...
There's more...
Using the Treeview widget
Getting ready
How to do it...
How it works...
There's more...
Using tags in Treeview items
See also
Populating nested items in a Treeview
Getting ready
How to do it...
How it works...
Displaying tabbable panes with Notebook
Getting ready
How to do it...
How it works...
There's more...
Applying Ttk styling
How to do it...
How it works...
Creating a datepicker widget
Getting ready
How to do it...
How it works...
See also
Other Books You May Enjoy
Leave a review - let other readers know what you think
- 高考英语历年真题核心高频688词汇(合肥新东方高考英语教研中心)
- 四季筵(清辰)
- 人机对话系统(曹均阔,陈国莲)
- 物联网与智慧城市(邵泽华)
- ARM 9嵌入式开发基础与实例进阶(光盘内容另行下载,地址见书封底)(冯新宇)
- 第7集 制度的起点是小人思维(俞凌雄)
- Orlando Furioso: Bilingual Edition (English – Italian)(Ludovico Ariosto)
- 做事先做人(李元秀 主编)
