1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| import wx, threading
import sys
import time
from wx.lib.pdfwin import PDFWindow
########################################################################
class MyPanel(wx.Panel):
""""""
#----------------------------------------------------------------------
def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent)
self.pdf = None
self.sizer = wx.BoxSizer( wx.VERTICAL )
self.Bind(wx.EVT_KEY_DOWN, self.onKey)
self.tmr=wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.addpdf(self), self.tmr)
self.tmr.Start(3000)
def addpdf(self, event):
self.pdf= PDFWindow(self, style=wx.SUNKEN_BORDER)
self.sizer.Add(self.pdf, proportion=1, flag=wx.EXPAND)
self.pdf.LoadFile("rot.pdf")
self.SetSizer(self.sizer)
self.SetAutoLayout(True)
#----------------------------------------------------------------------
def onKey(self, event):
key_code = event.GetKeyCode()
if key_code == wx.WXK_ESCAPE:
self.GetParent().Close()
else:
event.Skip()
def affichepdf (self,event) :
self.pdf= PDFWindow(self, style=wx.SUNKEN_BORDER)
pdfsizer= wx.BoxSizer( wx.VERTICAL )
pdfsizer.Add(self.pdf,proportion=1,flag=wx.EXPAND)
self.pdf.LoadFile("rot.pdf")
self.pdf.SetSizer(pdfsizer)
########################################################################
class MyFrame(wx.Frame):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title="Test FullScreen")
self.panel = MyPanel(self)
#self.ShowFullScreen(True)
if __name__ == "__main__":
app = wx.App(False)
frame = MyFrame()
frame.Show()
app.MainLoop() |
Partager