1 |
#!/usr/bin/env python |
2 |
#Boa:App:BoaApp |
3 |
|
4 |
# $Id: fraggleMain.py,v 1.4 2004/08/26 15:19:26 joko Exp $ |
5 |
# $Log: fraggleMain.py,v $ |
6 |
# Revision 1.4 2004/08/26 15:19:26 joko |
7 |
# get rid of urlOpener here |
8 |
# added key shortcuts to menu-items |
9 |
# |
10 |
|
11 |
import sys, os |
12 |
from wxPython.wx import * |
13 |
|
14 |
from fraggleConstants import * |
15 |
from fraggleEngine import * |
16 |
from fraggleViewport import * |
17 |
|
18 |
modules ={'fraggleDialogPrefs': [0, '', 'fraggleDialogPrefs.py'], |
19 |
'fraggleViewport': [1, '', 'fraggleViewport.py']} |
20 |
|
21 |
class BoaApp(wxApp): |
22 |
def OnInit(self): |
23 |
wxInitAllImageHandlers() |
24 |
self.main = fraggleMainWin(None) |
25 |
# needed when running from Boa under Windows 9X |
26 |
self.SetTopWindow(self.main) |
27 |
self.main.Show();self.main.Hide();self.main.Show() |
28 |
return True |
29 |
|
30 |
class fraggleMainWin(fraggleViewport): |
31 |
def _init_coll_menu1_Items(self, parent): |
32 |
|
33 |
if os.name == 'posix': |
34 |
fraggleViewport._init_coll_menu1_Items(self, parent) |
35 |
elif os.name == 'nt': |
36 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, '&Configure Netfraggle', "", wxITEM_NORMAL) |
37 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU1ITEMS1, '&Exit Netfraggle', "", wxITEM_NORMAL) |
38 |
|
39 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) |
40 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) |
41 |
|
42 |
def _init_coll_menu2_Items(self, parent): |
43 |
|
44 |
if os.name == 'posix': |
45 |
fraggleViewport._init_coll_menu2_Items(self, parent) |
46 |
elif os.name == 'nt': |
47 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU2CONT, '&Contents', "", wxITEM_NORMAL) |
48 |
parent.Append(wxID_FRAGGLEVIEWPORTMENU2ABOUT, '&About', "", wxITEM_NORMAL) |
49 |
|
50 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) |
51 |
EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) |
52 |
|
53 |
def main(): |
54 |
sys.path.append(os.path.join(APPLOCATION, '..', 'libs')) |
55 |
global engine |
56 |
engine = FraggleEngine() |
57 |
application = BoaApp(0) |
58 |
application.MainLoop() |
59 |
|
60 |
if __name__ == '__main__': |
61 |
main() |