Python论坛  - 讨论区

标题:Re: [python-chinese]奇怪的wxPython

2004年08月26日 星期四 15:32

mdkr mdkr at 163.com
Thu Aug 26 15:32:08 HKT 2004

就这代码,我CP了一个DEMO里的代码:
#----------------------------------------------------------------------
# A very simple wxPython example.  Just a wxFrame, wxPanel,
# wxStaticText, wxButton, and a wxBoxSizer, but it shows the basic
# structure of any wxPython application.
#----------------------------------------------------------------------

import wx


class MyFrame(wx.Frame):
    """
    This is MyFrame.  It just shows a few controls on a wxPanel,
    and has a simple menu.
    """
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title,
                          pos=(150, 150), size=(350, 200))

        # Create the menubar
        menuBar = wx.MenuBar()

        # and a menu 
        menu = wx.Menu()

        # add an item to the menu, using \tKeyName automatically
        # creates an accelerator, the third param is some help text
        # that will show up in the statusbar
        menu.Append(wx.ID_EXIT, "E&xit;\tAlt-X", "Exit this simple sample")

        # bind the menu event to an event handler
        self.Bind(wx.EVT_MENU, self.OnTimeToClose, id=wx.ID_EXIT)

        # and put the menu on the menubar
        menuBar.Append(menu, "&File;")
        self.SetMenuBar(menuBar)

        self.CreateStatusBar()
        

        # Now create the Panel to put the other controls on.
        panel = wx.Panel(self)

        # and a few controls
        text = wx.StaticText(panel, -1, "Hello World!")
        text.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD))
        text.SetSize(text.GetBestSize())
        btn = wx.Button(panel, -1, "Close")
        funbtn = wx.Button(panel, -1, "Just for fun...")

        # bind the button events to handlers
        self.Bind(wx.EVT_BUTTON, self.OnTimeToClose, btn)
        self.Bind(wx.EVT_BUTTON, self.OnFunButton, funbtn)

        # Use a sizer to layout the controls, stacked vertically and with
        # a 10 pixel border around each
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(text, 0, wx.ALL, 10)
        sizer.Add(btn, 0, wx.ALL, 10)
        sizer.Add(funbtn, 0, wx.ALL, 10)
        panel.SetSizer(sizer)
        panel.Layout()


    def OnTimeToClose(self, evt):
        """Event handler for the button click."""
        print "See ya later!"
        self.Close()

    def OnFunButton(self, evt):
        """Event handler for the button click."""
        print "Having fun yet?"


class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, "Simple wxPython App")
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
        
app = MyApp(True)
app.MainLoop()


----- Original Message ----- 
From: "limodou" <chatme at 263.net>
To: <python-chinese at lists.python.cn>
Sent: Thursday, August 26, 2004 2:48 PM
Subject: Re: [python-chinese]奇怪的wxPython


> mdkr,您好!
> 
> 代码贴出来。
> 
>     一般是
> 
>     from wx import *
> 
>     frame = Frame()
> 
>     这里wx可以省略
> 
>     如果import wx
> 
>     frame = wx.Frame() 
>    
>     wx不可以省略
> 
> ======= 2004-08-26 14:41:10 您在来信中写道:=======
> 
> >我刚装的wxPython2.5
> >现在Frame好象是先import wx然后再wx.Frame吧?
> >为什么DEMO上可以,我写的代码却说:
> >Traceback (most recent call last):
> >  File "", line 1, in ?
> >AttributeError: 'module' object has no attribute 'Frame'
> >呢?_______________________________________________
> >python-chinese list
> >python-chinese at lists.python.cn
> >http://python.cn/mailman/listinfo/python-chinese
> >
> 
> = = = = = = = = = = = = = = = = = = = =
> 
> 
>         致
> 礼!
>  
> 
>         limodou
>         chatme at 263.net
>           2004-08-26
> 
> 


--------------------------------------------------------------------------------


> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年08月26日 星期四 17:24

superxgz superxgz at 163.com
Thu Aug 26 17:24:28 HKT 2004

python-chinese,您好!
     我下了eclipse3.0和dev0.5,插件也启动了,可还是不知怎么用他们来编写,请问是否可以给我一个详细点的说明,谢谢
	

        致
礼!
 				

        superxgz
        superxgz at 163.com
          2004-08-26

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年08月26日 星期四 17:37

limodou chatme at 263.net
Thu Aug 26 17:37:30 HKT 2004

python-chinese,您好!


新增:

BookMark支持循环跳转 
可以设置当前的运行路径,方便脚本运行 
可以生成InnoSetup格式的Windows安装程序 
增加Ftp的上传和下载功能 
增加命令行选项 -f 可以不打开上次会话所保存的文件名 

修改:

对整个软件结构进行调整,提高启动速度 
所有的文件路径均自动处理为绝对路径 
升级说明:

因为此次修改了程序结构,应用2.5版升级相似,在运行 NewEdit 前应先执行tools/convert_opt2.6.py来转换newedit.opt。也可以简单地删除newedit.opt文件。

源码下载:http://wiki.woodpecker.org.cn/moin.cgi/NewEdit?action=AttachFile&do;=get⌖=neweidt_2.6r1.zip
Windows安装程序下载:http://wiki.woodpecker.org.cn/moin.cgi/NewEdit?action=AttachFile&do;=get⌖=NewEdit2.6.exe	

        致
礼!
 				

        limodou
        chatme at 263.net
          2004-08-26

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年08月26日 星期四 17:42

Iron Python lxp80 at hotmail.com
Thu Aug 26 17:42:48 HKT 2004

call jabber!!!!!!
JabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabberJabber
----- Original Message ----- 
From: "limodou" <chatme at 263.net>
To: "python-chinese" <python-chinese at lists.python.cn>
Sent: Thursday, August 26, 2004 2:20 PM
Subject: [python-chinese] 讨厌的UC


> python-chinese,您好!
> 
> 开了一会收到好几个广告,真烦人!再搞就关了它。
> 
>         致
> 礼!
>   
> 
>         limodou
>         chatme at 263.net
>           2004-08-26
> 


--------------------------------------------------------------------------------


> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号