help='Enable debug tracing') op.add_option('-s','--shared', action='store_true', default=False, help='Allow shared display') op.add_option('-f','--format', help='Set pixel format e.g. rgb222') op.add_option('-r','--region', help='Set region to update') op.add_option('-p','--password', metavar='FILE', help='Set VNC password from FILE') opts, args = op.parse_args() if not 1 <= len(args) <= 2: op.error('Wrong number of arguments') host = args[0] if len(args) > 1: port = 5900 + int(args[1]) else: port = 5900 if opts.region is not None: opts.region = map(int, opts.region.split('x')) level = (logging.DEBUG if opts.debug else logging.INFO) logging.basicConfig(level=level) password = None if opts.password is not None: password = open(opts.password).readline().rstrip() vnc = VncClient(host, port, shared=opts.shared, format=opts.format, region=opts.region, password=password) vnc.run()
Tk.__init__(self) #self.image = PhotoImage(file='/home/chah/www/ccfe.gif') slate = PIL.Image.new('RGB', (200,150)) sprite = PIL.Image.new('RGB', (50,50), color=(255,128,0)) slate.paste(sprite, (20,20,70,70)) self.photo = ImageTk.PhotoImage(image=slate) self.lab = Label(self, image=self.photo, width=200, height=150) self.lab.pack() if __name__=='__main__': import logging logging.basicConfig(level=logging.DEBUG) app = Tk() disp = Display(app, (800,600)) disp.pack() cl = VncClient('jtv.jet.efda.org',5925,format='rgb565',display=disp) cl.run() app.mainloop() if 0: #a = App() a = Tk() d = Display(a) d.pack() # slate = PIL.Image.new('RGB', (200,150)) # sprite = PIL.Image.new('RGB', (50,50), color=(255,128,0)) # d.display(slate) def splodge(): slate.paste(sprite, (20,20,70,70))