2
如何将工具提示添加到wx.Menu()的元素中?下面是我的项目编写的代码:wxPython - 将工具提示添加到菜单项目
#Patient menu (1st menu):
self.patientMenu = wx.Menu()
self.registerNewPatient = self.patientMenu.Append(-1, 'Cadastrar paciente...')
self.listPatientsByName = self.patientMenu.Append(-1, u'Listar pacientes em ordem alfabética')
self.listPatientsByNumber = self.patientMenu.Append(-1, u'Listar pacientes por número em ordem crescente')
self.searchForPatients = self.patientMenu.Append(-1, 'Pesquisar paciente(s)...')
#Appointment menu (2nd menu):
self.appointmentMenu = wx.Menu()
self.seeAppointmentsForToday = self.appointmentMenu.Append(-1, 'Visualizar consultas de hoje')
self.registerNewAppointment = self.appointmentMenu.Append(-1, 'Marcar consulta...')
self.cancelAppointment = self.appointmentMenu.Append(-1, 'Desmarcar consulta...')
self.seeAppointmentsForOtherSpecificDate = self.appointmentMenu.Append(-1, 'Pesquisar consultas...')
#Exit menu (3rd menu):
self.exitMenu = wx.Menu()
self.exitProgram = self.exitMenu.Append(-1, 'Encerrar')
#Menu bar:
self.menuBar = wx.MenuBar()
self.menuBar.Append(self.patientMenu, 'Paciente')
self.menuBar.Append(self.appointmentMenu, 'Consulta')
self.menuBar.Append(self.exitMenu, 'Sair')
self.SetMenuBar(self.menuBar)
谢谢你的链接。其实,我并没有这样想。为了提供带有简单工具提示的菜单元素,我希望这是一种简单的方法。 –
有:http://wxpython.org/Phoenix/docs/html/ToolTip.html?highlight=tooltip ...但这似乎是整个窗口。如果他们得到时间,您可能会收到Mike或Robin的回复。他们通常在wxpython标签上非常活跃。我还添加了另一个链接到balloontip。 – jmunsch