tkinter杂记=>长期更新
来源:互联网 发布:女生学软件测试 编辑:程序博客网 时间:2024/04/30 02:04
部分参考:
http://tieba.baidu.com/p/3082739560?pn=1
1. 3种系统信息提示方式
showinfo('greeting','Greeting') #(提示信息的标题,提示信息的内容)showerror('Not Implemented','Not yet available')#错误提示消息if askyesno('Verify quit','Are you sure you want to quit?'):#选择信(ask yes no=>askyesno) Frame(self).quit
2.改变光标显示
#Frametoolbar=Frame(self,cursor='hand2')#cursor->光标
3.禁用button与检测输入
#禁用buutonself.button_ok['state']='disable'#tkinter.DISABLED
检测输入,解锁button_ok:
def active_btn(self, event=None): ''' active the button_ok ''' def validate(): return self.entry_id and self.entry_passwd.get() if validate(): self.button_ok['state'] = ACTIVE##############self.button_ok.configure(command=self.apply)
注册管理还可以参考:
http://blog.csdn.net/bnanoou/article/details/38434443
4. quit 与 destroy区别
"quit() stops the TCL interpreter. This is in most cases what you want, because your Tkinter-app will also stop. It can be a problem, if you e.g. call your app from idle. idle is itself a Tkinker-app, so if you call quit() in your app and the TCL interpreter gets terminated, idle will also terminate (or get confused ).destroy() just terminates the mainloop and deletes all widgets. So it seems to be safer if you call your app from another Tkinter app, or if you have multiple mainloops."
taken from
http://www.daniweb.com/forums/thread66698.html
5. button 风格
tkinter.button #更多选择tkinter.ttk.button #设置风格button.config(style='Toolbutton')TkUtil.button()<=>tkinter.ttk.button
6.几个常见弹窗
from tkinter.filedialog import Open,SaveAs,Directoryfilename=Open(title='open').show()filename=SaveAs().show()filename=Directory().show()from subprocess import callcall(filename)
0 0
- tkinter杂记=>长期更新
- Linux 使用杂记(长期更新)
- 配置汇编环境=>可能会长期更新
- Java使用外部库=>长期更新
- tkinter菜单笔记=>持续更新
- ARM拾遗(长期更新)
- arx记录,长期更新
- 常用命令(长期更新)
- [长期更新]经验总结
- c++基础,长期更新
- 长期更新 名词解析
- 前端奇技淫巧《长期更新》
- mac 常用软件-长期更新
- 小知识点 长期更新
- 实用网站-长期更新
- Python练习(长期更新)
- 基础数学公式 长期更新
- 开发笔记,长期更新~
- left join on 和where条件的放置
- spring 声明式事务管理xml方式实现
- J2EE-13个常用规范
- 我是如何开始去了解Python函数式编程--Python函数式编程初涉
- Sql 新建表并插入1000随机数
- tkinter杂记=>长期更新
- java多线程基础部分探究
- SVN使用过程中的小感悟
- 学习习惯之时间管理工具
- 黑马程序员--C语言——基础语法
- 扩展欧几里德 POJ1061
- 嵌入式linux之USB设备驱动概念
- poj 3364 水题
- B\S备忘录24——Jquery原理简单作死向分析