--- nfo/projects/netfraggle/bin/fraggleMain.py 2004/08/25 13:53:48 1.1.1.1 +++ nfo/projects/netfraggle/bin/fraggleMain.py 2004/08/26 15:19:26 1.4 @@ -1,10 +1,17 @@ #!/usr/bin/env python #Boa:App:BoaApp -from wxPython.wx import * +# $Id: fraggleMain.py,v 1.4 2004/08/26 15:19:26 joko Exp $ +# $Log: fraggleMain.py,v $ +# Revision 1.4 2004/08/26 15:19:26 joko +# get rid of urlOpener here +# added key shortcuts to menu-items +# -import fraggleViewport +import os +from wxPython.wx import * +from fraggleViewport import * modules ={'fraggleDialogPrefs': [0, '', 'fraggleDialogPrefs.py'], 'fraggleViewport': [1, '', 'fraggleViewport.py']} @@ -12,12 +19,35 @@ class BoaApp(wxApp): def OnInit(self): wxInitAllImageHandlers() - self.main = fraggleViewport.create(None) + self.main = fraggleMainWin(None) # needed when running from Boa under Windows 9X self.SetTopWindow(self.main) self.main.Show();self.main.Hide();self.main.Show() return True +class fraggleMainWin(fraggleViewport): + def _init_coll_menu1_Items(self, parent): + + if os.name == 'posix': + fraggleViewport._init_coll_menu1_Items(self, parent) + elif os.name == 'nt': + parent.Append(wxID_FRAGGLEVIEWPORTMENU1FPREFS, '&Configure Netfraggle', "", wxITEM_NORMAL) + parent.Append(wxID_FRAGGLEVIEWPORTMENU1ITEMS1, '&Exit Netfraggle', "", wxITEM_NORMAL) + + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1FPREFS, self.OnMenu1items0Menu) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU1ITEMS1, self.OnMenu1items1Menu) + + def _init_coll_menu2_Items(self, parent): + + if os.name == 'posix': + fraggleViewport._init_coll_menu2_Items(self, parent) + elif os.name == 'nt': + parent.Append(wxID_FRAGGLEVIEWPORTMENU2CONT, '&Contents', "", wxITEM_NORMAL) + parent.Append(wxID_FRAGGLEVIEWPORTMENU2ABOUT, '&About', "", wxITEM_NORMAL) + + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2CONT, self.OnMenu2items0Menu) + EVT_MENU(self, wxID_FRAGGLEVIEWPORTMENU2ABOUT, self.OnMenu2items1Menu) + def main(): application = BoaApp(0) application.MainLoop()