当前位置: 首页>>代码示例>>Python>>正文


Python Gui.te方法代码示例

本文整理汇总了Python中swampy.Gui.te方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.te方法的具体用法?Python Gui.te怎么用?Python Gui.te使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在swampy.Gui的用法示例。


在下文中一共展示了Gui.te方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Gui

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import te [as 别名]
from swampy.Gui import *
g = Gui()
g.title("Gui")


text = g.te(width=100, height=5)
canvas = g.ca(width=300, height=300)
canvas.config(bg='grey')
circle = None
def change_color():
    global circle
    color = entry.get()
    print color
    if circle == None:
        return
    circle.config(fill=color)

def draw_circle():
    global circle
    circle = canvas.circle([0, 0], 100, fill='red')

g.bu(text='create circle', command=draw_circle)
entry = g.en()
g.bu(text='change color', command=change_color)



g.mainloop()
开发者ID:venkateshwaracholan,项目名称:Thinkpython,代码行数:30,代码来源:nineteen_three.py

示例2: range

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import te [as 别名]
for line in fp:
    t = line.split("\t")
    name = t[2].strip()
    lb.insert(END, name)

# tell the listbox and the scrollbar about each other
lb.configure(yscrollcommand=sb.set)
sb.configure(command=lb.yview)


# FRAME 4

g.col()

# te is for text entry
te = g.te(height=5, width=40)
te.insert(END, "This is a Text widget.\n")
te.insert(END, "It's like a little text editor.\n")
te.insert(END, "It has more than one line, unlike an Entry widget.\n")

# st is for scrollable text
st = g.st()
st.text.configure(height=5, width=40)

st.text.insert(END, "This is a Scrollable Text widget.\n")
st.text.insert(END, "It is defined in Gui.py\n")

for i in range(100):
    st.text.insert(END, "All work and no play.\n")

g.endcol()
开发者ID:Ehsan1981,项目名称:ThinkPython,代码行数:33,代码来源:widget_demo.py


注:本文中的swampy.Gui.te方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。