码迷,mamicode.com
首页 > 编程语言 > 详细

python__tkinter之listbox&button

时间:2015-03-04 14:18:10      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

 1 #!/bin/usr/python
 2 #-*- coding:utf-8 -*-
 3 
 4 from Tkinter import *
 5 
 6 class show(object):
 7     def __init__(self, master):
 8         frame = Frame(master)
 9         frame.pack()
10         
11         self.button = Button(frame, text=ADD, command=self.add)
12         self.listbox = Listbox(master)
13         self.listbox.pack(side=LEFT)
14         self.button.pack(side=LEFT)
15 
16         self.listbox.insert(END, a list entry)
17         
18         for item in [one, two, three, four]:
19             self.listbox.insert(END, item)
20     
21     def add(self):
22         self.listbox.insert(END,five)
23 
24 master = Tk()
25 app = show(master)
26 
27 master.mainloop()

http://effbot.org/tkinterbook/listbox.htm

python__tkinter之listbox&button

标签:

原文地址:http://www.cnblogs.com/wizzhangquan/p/4312992.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!