client.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:deb-python-autobahn 作者: openstack 项目源码 文件源码
def __init__(self, app):
        # First, call the base class' __init__ method to create the frame
        wx.Frame.__init__(self, None, -1, "wxPython/Autobahn WebSocket Demo")
        self._app = app

        # Associate some events with methods of this class
        self.Bind(wx.EVT_MOVE, self.OnMove)

        # Add a panel and some controls to display the size and position
        panel = wx.Panel(self, -1)
        label1 = wx.StaticText(panel, -1, "WebSocket messages received:")
        label2 = wx.StaticText(panel, -1, "Window position:")
        self.sizeCtrl = wx.TextCtrl(panel, -1, "", style=wx.TE_READONLY)
        self.posCtrl = wx.TextCtrl(panel, -1, "", style=wx.TE_READONLY)
        self.panel = panel

        # Use some sizers for layout of the widgets
        sizer = wx.FlexGridSizer(2, 2, 5, 5)
        sizer.Add(label1)
        sizer.Add(self.sizeCtrl)
        sizer.Add(label2)
        sizer.Add(self.posCtrl)
        border = wx.BoxSizer()
        border.Add(sizer, 0, wx.ALL, 15)
        panel.SetSizerAndFit(border)
        self.Fit()

    # This method is called by the System when the window is moved,
    # because of the association above.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号