Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     
当前位置: 主页 > Java文档 > Python技术 >

tkinter-gui-programming-example PDF 下载


时间:2024-08-17 08:41来源:http://www.java1234.com 作者:转载  侵权举报
tkinter-gui-programming-example
失效链接处理
tkinter-gui-programming-example PDF 下载

 
 
相关截图:
 


主要内容:

Beginning our text editor
Before writing any code, be sure to make a new folder to hold the files for this chapter.
Inside this folder, create a file called textarea.py. This file will hold the main part of our
text editora subclass of the Text widget.
The Text widget is such as a textarea tag within HTML. It holds multiple lines of text
and many formatting options. In the next chapter, we will see just how powerful this
widget can be with the use of concepts like tags and indexing, which alter the text's
appearance and give us control over certain regions of the text, allowing us to search all
over the document within.
For now, we will just need a simple instance of the widget with a couple of configuration
options set:
import tkinter as tk
class TextArea(tk.Text):
def __init__(self, master, **kwargs):
super().__init__(**kwargs)
self.master = master
self.config(wrap=tk.WORD)
Although initially short, this is all we need at the moment for our Text widget subclass.
After initializing the Text widget superclass, we assign the master widget as an attribute
which will allow us to send information back to the main application window in the future.
 


 

------分隔线----------------------------


锋哥推荐