Example #1
0
File: image.py Project: pyzzz/mygtk
def get_screenshot(window):
	w, h = window.get_size()
	pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, w, h)
	pixbuf.get_from_drawable(window, window.get_colormap(), 0, 0, 0, 0, w, h)
	pixbuf.save(share.SCREENSHOT_PATH, share.SCREENSHOT_FORMAT)
	img = Image(share.SCREENSHOT_PATH)
	lock.remove_file(share.SCREENSHOT_PATH)
	return img
Example #2
0
def run():
    if os.path.exists(share.LOCK_PATH):
        lock.remove_file(share.LOCK_PATH)
        log.msg("check lock...")
        for i in xrange(5):
            time.sleep(0.5)
            if os.path.exists(share.LOCK_PATH):
                log.err("lock exist, exit")
                lock.create_file(share.RESTORE_PATH)
                os._exit(1)
    timer.timeout_add(500, lock.check_lock)
    share.MAIN_WINDOW.show()
    gtk.main()
Example #3
0
def run():
	if os.path.exists(share.LOCK_PATH):
		lock.remove_file(share.LOCK_PATH)
		log.msg("check lock...")
		for i in xrange(5):
			time.sleep(0.5)
			if os.path.exists(share.LOCK_PATH):
				log.err("lock exist, exit")
				lock.create_file(share.RESTORE_PATH)
				os._exit(1)
	timer.timeout_add(500, lock.check_lock)
	share.MAIN_WINDOW.show()
	gtk.main()
Example #4
0
File: event.py Project: pyzzz/mygtk
def exit(*args):
	#log.msg("exit")
	lock.remove_file(share.LOCK_PATH)
	gtk.main_quit()
Example #5
0
def exit(*args):
    #log.msg("exit")
    lock.remove_file(share.LOCK_PATH)
    gtk.main_quit()