Python GUI编程——wxPython学习(1)
2014-07-03 22:14
555 查看
静态文本显示:
View Code
# -*- coding: cp936 -*- # stxt.py """ stxt.py 2014/7/3 简单静态文本显示 """ import wx class StaticTextFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, 'Static Text Example',size=(400, 800)) panel = wx.Panel(self,-1) self.textlabel = [#"import wx", #"class StaticTextFrame(wx.Frame):", #"def __init__(self):", "wx.Frame.__init__(self, None, -1, 'Static Text Example',size=(400, 300))", "panel = wx.Panel(self,-1)"] styles = {"默认样式":0, "wxALIGN_LEFT":wx.ALIGN_LEFT, "wxALIGN_RIGHT":wx.ALIGN_RIGHT, "wxALIGN_CENTRE_HORIZONTAL":wx.ALIGN_CENTRE_HORIZONTAL, "wxST_NO_AUTORESIZE":wx.ST_NO_AUTORESIZE, "wxST_ELLIPSIZE_START":wx.ST_ELLIPSIZE_START, "wxST_ELLIPSIZE_MIDDLE":wx.ST_ELLIPSIZE_MIDDLE, "wxST_ELLIPSIZE_END":wx.ST_ELLIPSIZE_END} i=0 for stylename in styles.keys(): st = wx.StaticText(self,-1,stylename,pos=(10,20+i*30)) st.SetForegroundColour("blue") for tb in self.textlabel: i=i+1 wx.StaticText(self,-1,tb,pos=(10,20+i*30),style=0 | styles[stylename],size=(300,30)) i=i+1 def main(): app=wx.App() Frame=StaticTextFrame() Frame.SetBackgroundColour("white") #设置背景颜色 Frame.Show() app.MainLoop() if __name__=="__main__": main()
View Code
相关文章推荐
- python的GUI编程--wxpython学习(一)--安装和原理步骤
- python的GUI编程--wxpython学习(二)--基本控件和事件
- python的GUI编程--wxpython学习(三)两个布局
- python的GUI编程--wxpython学习(四)-->练习:一个自动测试app启动时间的小工具
- wxPython--Python GUI编程参考链接
- wxPython Phoenix 和python3.4的编程学习
- python图形界面GUI编程之wxpython安装
- python学习笔记——Tkinter GUI编程——简介
- 如何安装 wxPython 开始 python GUI 编程
- 【脚本语言系列】关于PythonGUI编程wxPython, 你需要知道的事
- python学习笔记——Tkinter GUI编程——简介
- python GUI编程——wxpython编写简单记事本程序
- python图形界面GUI编程之wxpython布局
- python学习——初次接触(python,wxpython,Boa,py2exe)
- Python GUI编程-了解相关技术[整理]
- GUI编程学习第一弹:《计算器》。尽量面相对象,但依然不给力。仍旧全文注释,大家一起勉励
- Python的GUI开发:小试wxPython(上)
- 六本学习Python语言编程的免费电子书
- python核心编程学习(第三章)
- 学习简单的python----最简单的python GUI例子 1