#!/boot/home/config/bin/python
#  Copyright 1999 by Donn Cave, Seattle, Washington, USA.
#  All rights reserved.  Permission to copy, modify and distribute this
#  material is hereby granted, without fee, provided that the above
#  copyright notice appear in all copies.
#
#  Application and main window.
#
import pickle

from BApplication import BApplication
from BMessenger import BMessenger

from errpt import LastChanceLooper

import configure
from core import core
import blindprompt
import mail
import main
import news
import queue

from AppKit import B_QUIT_REQUESTED
from InterfaceKit import B_PLAIN_BORDER,B_NO_BORDER,B_FANCY_BORDER,B_TITLED_WINDOW,B_NOT_ZOOMABLE,B_NOT_RESIZABLE,B_WILL_DRAW,B_NAVIGABLE,B_FOLLOW_ALL,B_FOLLOW_LEFT,B_FOLLOW_TOP

class PyNR(queue.CallQueue, blindprompt.MainFn, mail.MainFn, news.MainFn, BApplication):
	def __init__(self):
		BApplication.__init__(self, "application/x-vnd.PyNR")
		core.register('exit', self)
		# print dir(self)
		mail.MainFn.__init__(self)
		news.MainFn.__init__(self)
		blindprompt.MainFn.__init__(self)
		# self.qzinit()
		self.qzcall_queue = []
		self.qzcall_gate = queue.Semaphore(1)
		self.qzmessenger = BMessenger(self)
	def exit(self, err):
		self.PostMessage(B_QUIT_REQUESTED)
	def ReadyToRun(self):
		configure.init()
		window = main.MenuWindow()
		window.Show()

myApplication = PyNR()
myApplication.Run()
