Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5708778
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: Python/Ruby

2006-07-23 21:57:23

今天尝试python的GUI编程,因为是急于Tkinter的,在linux下界面作出来比较丑。

Element


Tkinter Class


Description


Frame


Frame


Holds other GUI elements


Label


Label


Displays uneditable text or icons


Button


Button


Performs an action when the user activates it


Text entry


Entry


Accepts and displays one line of text


Text box


Text


Accepts and displays multiple lines of text


Check button


Checkbutton


Allows the user to select or not select an option


Radio button


Radiobutton


Allows, as a group, the user to select one option from several






from Tkinter import *

class Application(Frame):
    def __init__(self,master):
       Frame.__init__(self,master)
       self.grid()
       self.create_widgets()
    def create_widgets(self):
       ……………………………………

root=Tk()
root.titel("****")
root.geometry("500x200") #注意是字母x,不是乘号×
app = Application(root)

root.mainloop()

阅读(2584) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~