messages.py 文件源码

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

项目:pinder 作者: dhharris 项目源码 文件源码
def display_matches(self):
        self.mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.images = []
        self.labels = []
        m = self.session.matches()

        for i in range(len(m)):
            match = m[i]
            # Thumb
            fd = urlopen(match.user.thumbnails[0])
            file = io.BytesIO(fd.read())
            img = wx.Image(file, wx.BITMAP_TYPE_ANY)
            self.images.append(wx.StaticBitmap(self.panel, wx.ID_ANY,
                                         wx.Bitmap(img)))
            self.images[i].Bind(wx.EVT_BUTTON, self.onClick)
            # Label for name
            self.labels.append(wx.StaticText(self.panel, label=match.user.name))

            # Add to sizer
            self.mainSizer.Add(self.labels[i], 0, wx.ALL, 5)
            self.mainSizer.Add(self.images[i], 0, wx.ALL, 5)

        self.mainSizer.Add(self.sizer, 0, wx.ALL, 5)
        self.panel.SetSizer(self.mainSizer)
        self.panel.Layout()
        self.panel.Refresh()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号