Esempio n. 1
0
def addToMenu( master, menu, repository, window ):
	"Add a tool plugin menu."
	path = preferences.getPathFromFileNameHelp( repository.fileNameHelp )
	openDocumentationCommand = preferences.HelpPage().getOpenFromDocumentationSubName( repository.fileNameHelp )
	preferences.addAcceleratorCommand( '<F1>', openDocumentationCommand, master, menu, os.path.basename( path ).capitalize() )
	menu.add_separator()
	helpRepository = HelpRepository()
	preferences.addMenuEntitiesToMenu( menu, helpRepository.menuEntities )
Esempio n. 2
0
	def centerUpdateSetWindowGeometryShowPreferences( self, center ):
		"Center the scroll region, update, set the window geometry, and show the preferences."
		self.preferencesMenu = preferences.Tkinter.Menu( self.fileHelpMenuBar.menuBar, tearoff = 0 )
		self.fileHelpMenuBar.addMenuToMenuBar( "Preferences", self.preferencesMenu )
		preferences.addMenuEntitiesToMenu( self.preferencesMenu, self.repository.menuEntities )
		self.relayXview( preferences.Tkinter.MOVETO, center.real * self.oneMinusCanvasWidthOverScreenWidth )
		self.relayYview( preferences.Tkinter.MOVETO, center.imag * self.oneMinusCanvasHeightOverScreenHeight )
		self.root.withdraw()
		self.root.update_idletasks()
		movedGeometryString = '%sx%s+%s' % ( self.root.winfo_reqwidth(), self.root.winfo_reqheight(), '0+0' )
		self.root.geometry( movedGeometryString )
		self.repository.phoenixUpdateFunction = self.phoenixUpdate
		self.repository.updateFunction = self.update