gui.py 文件源码

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

项目:stopgo 作者: notklaatu 项目源码 文件源码
def BuildTimeline(self,dbfile):

        for child in self.panel3.GetChildren():
            logging.exception(child)
            child.Destroy()

        # the last frame is
        latestfram = self.cur.execute("SELECT * FROM Timeline ORDER BY Image DESC LIMIT 1")
        #latestfram = self.cur.execute("SELECT * FROM Timeline WHERE ID = (SELECT MAX(ID) FROM TABLE) AND Blackspot = 0");
        try:
            for entry in latestfram:
                self.framlog = int(entry[1].split('.')[0])
                self.framlog += 1
                logging.exception(self.framlog)
        except:
            logging.exception('Looking for last frame but did not find.')
            pass

        # timeline contains
        tbl_timeline = self.cur.execute("SELECT * FROM Timeline WHERE Blackspot=0")

        for entry in tbl_timeline:
            img = self.MakeThumbnail(os.path.join(self.imgdir, entry[1]), self.thumbsize)
            self.imageCtrl = wx.StaticBitmap(self.panel3, wx.ID_ANY, 
                                             wx.BitmapFromImage(img),name=entry[1]) 
            self.imageCtrl.SetBitmap(wx.BitmapFromImage(img))
            self.imageCtrl.Bind( wx.EVT_LEFT_DOWN, self.OnLeftClick )
            self.imageCtrl.Bind( wx.EVT_LEFT_UP, self.OnLeftRelease )

            logging.exception(self.imageCtrl.GetId() )
            self.hbox2.Add( self.imageCtrl, 0, wx.ALL, 5 )

        self.Layout()
        self.panel3.SetFocus()
        self.BindKeys(dbfile)

        self.hbox2.Layout()
        self.panel3.Refresh()
        self.panel3.Update()

        self.Refresh()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号