Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Scale/Scale的Command)——Jason niu
2018-03-19 23:18
609 查看
#tkinter应用案例:利用指定范围的Scale组件实现 from tkinter import * root = Tk() root.title("Jason niu工作室") theLabel=tk.Label(root,text="进入GUI世界,请开始你的表演!\nScale组件控制滚动范围") theLabel.pack() s1=Scale(root,from_=0,to=100) s1.pack() s2=Scale(root,from_=0,to=2018,orient=HORIZONTAL) s2.pack() def show(): print(s1.get(),s2.get()) Button(root,text="获取位置",command=show).pack() mainloop()
#tkinter应用案例:利用指定范围的Scale组件实现点击按钮获取当前坐标点 from tkinter import * root = Tk() root.title("Jason niu工作室") theLabel=tk.Label(root,text="进入GUI世界,请开始你的表演!\n点击下方按钮即可获得你想要的坐标点") theLabel.pack() s1=Scale(root,from_=0,to=100,tickinterval=10,resolution=20,length=100) s1.pack() s2=Scale(root,from_=0,to=2018,tickinterval=100,resolution=200,orient=HORIZONTAL,length=500) s2.pack() def show(): print(s1.get(),s2.get()) Button(root,text="获取位置",command=show).pack() mainloop()
相关文章推荐
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Menu/Menu的Command)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Menu的Command)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Entry/Entry的Command)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(计算器简单功能)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Find/undo事件)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Canvas)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Button的command/Label/PhotoImage/封装为类)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Button展示图片事件/)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(LabelFrame/Checkbutton/Radiobutton)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(text.insert/link各种事件)——Jason niu
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Listbox/Scrollbar)——Jason niu
- Py之tkinter:python最简单的猜字小游戏带你进入python的GUI世界
- 鱼c笔记——Python的GUI编程(五):Tkinter组件Listbox、Scrollbar和Scale
- Tkinter, a Gui for python
- Python GUI之tkinter 实战(一)
- 使用Tkinter做python的GUI编程
- Python GUI:高级作图tkinter模块的常用函数.md
- 用一个简单示例演示在python中调用C及C++
- 在Java中动态传参调用Python脚本
- python GUI tkinter小结